Skip to content

Commit 429857b

Browse files
author
Josh Fromm
authored
One more little one (apache#5)
* Fixed fake quantize issues. * Formatting. * Cleanup unused imports * Fix real int8 tests. * Fix requantize shape bug.
1 parent f707c70 commit 429857b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/relay/qnn/op/requantize.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,11 @@ Expr RequantizeLower(const Expr& input_tensor, const Expr& input_scale,
139139
auto zero_scalar = MakeConstantScalar(DataType::Int(32), 0);
140140
if (!IsEqualScalar(input_zero_point, zero_scalar)) {
141141
// Broadcast input zero point if needed.
142-
Expr input_zero_broadcast =
143-
ExpandBiasToMatchAxis(input_zero_point, input_shape.size(), {param->axis});
142+
Expr input_zero_broadcast = ExpandBiasToMatchAxis(Reshape(input_zero_point,
143+
{
144+
-1,
145+
}),
146+
input_shape.size(), {param->axis});
144147
tensor = Subtract(tensor, Cast(input_zero_broadcast, DataType::Int(32)));
145148
}
146149

0 commit comments

Comments
 (0)