Skip to content

Commit

Permalink
to #25957442 update code
Browse files Browse the repository at this point in the history
  • Loading branch information
yunjing.lh committed Mar 21, 2020
1 parent 9609f66 commit 85e1815
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/relay/qnn/op/add.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,16 @@ Expr QnnAddCanonicalize(const Attrs& attrs, const Array<Expr>& new_args,
auto requantized_lhs = Requantize(lhs, input_shape,
real_lhs_scale, lhs_zero_point,
itmd_out_scale, itmd_zero_point,
DataType::Int(32), rounding);
DataType::Int(32));
auto requantized_rhs = Requantize(rhs, input_shape,
real_rhs_scale, rhs_zero_point,
itmd_out_scale, itmd_zero_point,
DataType::Int(32), rounding);
DataType::Int(32));
output = Add(requantized_lhs, requantized_rhs);
output = Requantize(output, input_shape,
real_out_scale, itmd_zero_point,
itmd_out_scale, output_zero_point,
DataType::Int(32), rounding);
DataType::Int(32));
} else {
// FIXME (anijain2305) - The lowering can be further optimized. Instead of inserting requantize
// in the start, we can insert requantize at the end if both input tensors have same qnn params.
Expand Down
2 changes: 1 addition & 1 deletion tests/python/frontend/tflite/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,7 @@ def test_forward_qnn_mobilenet_v2_net():

tflite_output = run_tflite_graph(tflite_model_buf, data)
tflite_predictions = np.squeeze(tflite_output)
tvm_output = run_tvm_graph(tflite_model_buf, data, 'input', opt_level=2)
tvm_output = run_tvm_graph(tflite_model_buf, data, 'input')
tvm_predictions = np.squeeze(tvm_output)
tvm.testing.assert_allclose(tvm_predictions, tflite_predictions,
rtol=0, atol=0)
Expand Down

0 comments on commit 85e1815

Please sign in to comment.