giuseros commented on a change in pull request #5980: URL: https://github.com/apache/incubator-tvm/pull/5980#discussion_r454420817
########## File path: src/relay/op/tensor/unary.cc ########## @@ -274,6 +274,20 @@ TVM_REGISTER_GLOBAL("relay.op._make.clip").set_body_typed([](Expr a, double a_mi return Call(op, {a}, Attrs(attrs), {}); }); +// relay.fixed_point_multiply +TVM_REGISTER_NODE_TYPE(FixedPointMultiplyAttrs); + +RELAY_REGISTER_OP("fixed_point_multiply") + .describe(R"code( fixed point multiplication )code" TVM_ADD_FILELINE) + .set_num_inputs(1) + .add_argument("data", "Tensor", "The input tensor.") + .add_type_rel("Identity", IdentityRel) + .set_attr<TOpPattern>("TOpPattern", kElemWise) + .set_attr<TOpIsStateful>("TOpIsStateful", false) + .set_attr<FInferCorrectLayout>("FInferCorrectLayout", ElemwiseArbitraryLayout) + .set_attrs_type<FixedPointMultiplyAttrs>() + .set_support_level(3); Review comment: The reason why it is three is that we could implement requantization through only clipping and/or cast, which are level 3 as well. Moreover, from here: https://tvm.apache.org/docs/langref/relay_op.html#overview-of-operators, 3 is for additional math operators which seems the right category. However, either way it is fine for me. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org