From a9a3ad564a885be65f6a99a5315356da5150191d Mon Sep 17 00:00:00 2001 From: Sebastian Larsson Date: Wed, 2 Apr 2025 14:52:50 +0200 Subject: [PATCH] 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 --- .../_passes/fold_qdq_with_annotated_qparams_pass.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backends/arm/_passes/fold_qdq_with_annotated_qparams_pass.py b/backends/arm/_passes/fold_qdq_with_annotated_qparams_pass.py index 963759bfa6d..4d265534f97 100644 --- a/backends/arm/_passes/fold_qdq_with_annotated_qparams_pass.py +++ b/backends/arm/_passes/fold_qdq_with_annotated_qparams_pass.py @@ -136,8 +136,14 @@ def call(self, graph_module: GraphModule) -> PassResult: continue # Make sure we haven't already set qparams meta information on the node - assert "input_qparams" not in n.meta.keys() - assert "output_qparams" not in n.meta.keys() + assert "input_qparams" not in n.meta, ( + f'Unexpected key "input_qparams" found in meta for node {n}. ' + "input_qparams should not have been set at this point" + ) + assert "output_qparams" not in n.meta, ( + f'Unexpected key "output_qparams" found in meta for node {n}. ' + "output_qparams should not have been set at this point" + ) # for the inputs and outputs search the graph for quantization info and # store the information in a dict with order of the _tensor_ inputs as key,