Commit 1c0e7435 by Animesh Jain Committed by Zhi

[QNN] Change default rouning to UPWARD. (#4131)

parent 11a3a777
...@@ -49,7 +49,7 @@ struct RequantizeAttrs : public tvm::AttrsNode<RequantizeAttrs> { ...@@ -49,7 +49,7 @@ struct RequantizeAttrs : public tvm::AttrsNode<RequantizeAttrs> {
.describe("The scale of the output tensor."); .describe("The scale of the output tensor.");
TVM_ATTR_FIELD(output_zero_point) TVM_ATTR_FIELD(output_zero_point)
.describe("The zero point of the output tensor."); .describe("The zero point of the output tensor.");
TVM_ATTR_FIELD(rounding).set_default("TONEAREST") TVM_ATTR_FIELD(rounding).set_default("UPWARD")
.describe("Defines the rounding direction when the value is midway between" .describe("Defines the rounding direction when the value is midway between"
"two representable values. There are two supported modes - UPWARD" "two representable values. There are two supported modes - UPWARD"
"or TONEAREST. Both modes behave exactly same except at the" "or TONEAREST. Both modes behave exactly same except at the"
......
...@@ -27,7 +27,7 @@ def requantize(data, ...@@ -27,7 +27,7 @@ def requantize(data,
input_zero_point, input_zero_point,
output_scale, output_scale,
output_zero_point, output_zero_point,
rounding="TONEAREST", rounding="UPWARD",
out_dtype="int8"): out_dtype="int8"):
r"""Requantized operator. r"""Requantized operator.
......
...@@ -76,7 +76,7 @@ Expr RequantizeLower(const Expr& input_tensor, const RequantizeAttrs* param, ...@@ -76,7 +76,7 @@ Expr RequantizeLower(const Expr& input_tensor, const RequantizeAttrs* param,
static inline Expr Requantize(const Expr& data, const Array<IndexExpr>& input_shape, static inline Expr Requantize(const Expr& data, const Array<IndexExpr>& input_shape,
double input_scale, int32_t input_zero_point, double output_scale, double input_scale, int32_t input_zero_point, double output_scale,
int32_t output_zero_point, const DataType& out_dtype, int32_t output_zero_point, const DataType& out_dtype,
const std::string& rounding = "TONEAREST") { const std::string& rounding = "UPWARD") {
auto attrs = make_node<RequantizeAttrs>(); auto attrs = make_node<RequantizeAttrs>();
attrs->input_scale = std::move(input_scale); attrs->input_scale = std::move(input_scale);
attrs->input_zero_point = std::move(input_zero_point); attrs->input_zero_point = std::move(input_zero_point);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment