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

 ##########
 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:
   Well, I actully just found the issue,  the code is copied from merged PR 
#14097, which had a similar issue. I think it is better to keep the same 
assumpation for all *_like op need to relax type requirment.  

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to