Skip to content

Commit a9a3ad5

Browse files
Add info message to assertions in fold_qdq_with_annotated_qparams_pass
Add explanation for why the asserts would trigger. Change-Id: I35cb323c848c706c236cdefcd40d40fe68dd5f21 Signed-off-by: Sebastian Larsson <[email protected]>
1 parent 4717459 commit a9a3ad5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

backends/arm/_passes/fold_qdq_with_annotated_qparams_pass.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,14 @@ def call(self, graph_module: GraphModule) -> PassResult:
136136
continue
137137

138138
# Make sure we haven't already set qparams meta information on the node
139-
assert "input_qparams" not in n.meta.keys()
140-
assert "output_qparams" not in n.meta.keys()
139+
assert "input_qparams" not in n.meta, (
140+
f'Unexpected key "input_qparams" found in meta for node {n}. '
141+
"input_qparams should not have been set at this point"
142+
)
143+
assert "output_qparams" not in n.meta, (
144+
f'Unexpected key "output_qparams" found in meta for node {n}. '
145+
"output_qparams should not have been set at this point"
146+
)
141147

142148
# for the inputs and outputs search the graph for quantization info and
143149
# store the information in a dict with order of the _tensor_ inputs as key,

0 commit comments

Comments
 (0)