wkcn commented on a change in pull request #17977: Relaxing type requirements 
for broadcast_like
URL: https://github.com/apache/incubator-mxnet/pull/17977#discussion_r404042799
 
 

 ##########
 File path: src/operator/tensor/broadcast_reduce_op_value.cc
 ##########
 @@ -138,7 +138,16 @@ NNVM_REGISTER_OP(broadcast_like)
     [](const NodeAttrs& attrs) {
       return std::vector<std::string>{"lhs", "rhs"};
     })
-.set_attr<nnvm::FInferType>("FInferType", ElemwiseType<2, 1>)
+.set_attr<nnvm::FInferType>("FInferType", [](const nnvm::NodeAttrs& attrs,
+                                             std::vector<int> *in_attrs,
+                                             std::vector<int> *out_attrs) {
+  CHECK_EQ(in_attrs->size(), 2) << " in operator " << attrs.name;
+  std::vector<int> checked_in_attrs = { (*in_attrs)[0] };
+  bool ret = !type_is_none((*in_attrs)[1]) &&
 
 Review comment:
   Thanks for your contribution!
   
   Is it necessary for the condition `!type_is_none((*in_attrs)[1])` ?

----------------------------------------------------------------
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


With regards,
Apache Git Services

Reply via email to