File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
neural_compressor/adaptor/tf_utils/graph_rewriter/generic Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,13 @@ def do_transformation(self):
169
169
170
170
# Mul (input, Mul)
171
171
input_data_op = node_from_map (input_node_map , data_scale_mul_op .input [0 ])
172
+ # Workaround for model ava-person-vehicle-detection-stage2-2_0_0
173
+ # FusedBatchNorm requires a 4D Tensor for input data, but MatMul only support 2D output.
174
+ # Don't fuse the small ops to FusedBatchNorm when the upstream has MatMul.
175
+ ancestor_input_data_op = node_from_map (input_node_map , input_data_op .input [0 ])
176
+ if input_data_op .op == "MatMul" or ancestor_input_data_op .op == "MatMul" :
177
+ continue
178
+
172
179
scale_op = node_from_map (input_node_map , data_scale_mul_op .input [1 ])
173
180
174
181
if scale_op .op == "Rsqrt" :
@@ -370,4 +377,4 @@ def get_const_dim_count(node_def):
370
377
Number of dimensions for the Const node.
371
378
"""
372
379
const_value = values_from_const (node_def )
373
- return const_value .ndim
380
+ return const_value .ndim
You can’t perform that action at this time.
0 commit comments