We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b04849 commit 19818afCopy full SHA for 19818af
ai_edge_quantizer/calibrator.py
@@ -140,10 +140,15 @@ def calibrate(
140
graph_info = qtyping.GraphInfo(
141
subgraph.tensors, self._flatbuffer_model.buffers
142
)
143
- # Add input/output operators to the subgraph.
144
- subgraph.operators += (
145
- tfl_flatbuffer_utils.get_subgraph_input_output_operators(subgraph)
146
- )
+ # Add input/output operators if they are not in the subgraph.
+ if not any(
+ isinstance(op, qtyping.IOOperator) for op in subgraph.operators
+ ):
147
+ subgraph.operators += (
148
+ tfl_flatbuffer_utils.get_subgraph_input_output_operators(
149
+ subgraph
150
+ )
151
152
for op in subgraph.operators:
153
if isinstance(op, qtyping.IOOperator):
154
op_key = op.op_key
0 commit comments