Skip to content

Commit 04619a3

Browse files
author
Harish
committed
revised version of quantize_graph
1 parent 42df7a0 commit 04619a3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/qonnx/transformation/quantize_graph.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ def adjust_graph(model, input_positions, node_name, quantized_nodes):
140140

141141
class QuantizeGraph(Transformation):
142142
"""This transformation can be used to introduce a Quant node for a specific type of node in the graph.
143-
Users would be able to specify the location of the quant node by providing the input and output indexs
143+
Users would be able to specify the location of the quant node by providing the input and output index
144144
as the parameters.
145145
146146
1) Expectations:
147147
a) Onnx model in the modelwraper format.
148-
b) Model must be cleaned using cleanup_model qonnx.util.cleanup.cleanup_model()
148+
b) Model must be cleaned using qonnx.util.cleanup.cleanup_model()
149149
c) Batchsize to be set.
150150
151-
2) S.teps to transform are:
151+
2) Steps to transform are:
152152
Step1: Finding the input for the quant node.
153153
Step2: Finding the consumer of the quant node output.
154154
Step3: Finding the shape for the output tensor of quant node.
@@ -157,7 +157,7 @@ class QuantizeGraph(Transformation):
157157
158158
3) Input:
159159
A dict "quantnode_map" specifying the criterion, positions, and input parameters like
160-
scale, bitwidth, zeropoint, and others for the particular quantnode.
160+
scale, bitwidth, zeropoint, and others for a specific quantnode.
161161
162162
Criterion:
163163
a) name: This will allow users to add quant nodes for specific node like "Conv_0" and "Gemm_0".
@@ -171,9 +171,9 @@ class QuantizeGraph(Transformation):
171171
in comparison to "op_type".
172172
173173
Positions: ("input", index) or ("output", index)
174-
a) "input": specifies that the user want to quantize the input of the selected node.
175-
b) "output": specifies that the user want to quantize the input of the selected node.
176-
c) index: specifies which input/output to quantize (as a node can have multiple inputs and outputs)
174+
a) "input": indicates that the user want to quantize the input of the selected node.
175+
b) "output": indicates that the user want to quantize the output of the selected node.
176+
c) index: refers to the input/output index to quantize (a node can have multiple inputs and outputs)
177177
178178
Parameters (to quant node) are provided as (scale, zeropoint, bitwidth, narrow, signed, rounding_mode)
179179

tests/transformation/test_quantize_graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def to_verify(model, test_details):
9191

9292
if by == "name":
9393
sample_node_name = random.choice(list(test_details["name"].keys()))
94-
sample_node = model.node_from_name(model, sample_node_name)
94+
sample_node = model.get_node_from_name(sample_node_name)
9595
sample_pos = random.choice(test_details["name"][sample_node_name])
9696
if by == "op_type":
9797
node_type = random.choice(list(test_details["op_type"].keys()))

0 commit comments

Comments
 (0)