We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b9bda33 commit ed07bbaCopy full SHA for ed07bba
ai_edge_quantizer/transformation_instruction_generator.py
@@ -186,11 +186,13 @@ def _tensor_info_generator(
186
A tuple of tensor_name and TensorGraphInfo.
187
"""
188
for tensor_id, tensor in enumerate(subgraph.tensors):
189
- consumers = [
190
- op_id
191
- for (op_id, op) in enumerate(subgraph.operators)
192
- if tensor_id in op.inputs
193
- ]
+ consumers = []
+ for op_id, op in enumerate(subgraph.operators):
+ # Some ops may use the same input tensor multiple times,
+ # and we should handle each time independently.
+ for op_input in op.inputs:
194
+ if op_input == tensor_id:
195
+ consumers.append(op_id)
196
producer = -1
197
for op_id, op in enumerate(subgraph.operators):
198
if tensor_id in op.outputs:
0 commit comments