You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/04/06 13:05:18 UTC

[GitHub] [incubator-mxnet] tobecontinued commented on a change in pull request #17977: Relaxing type requirements for broadcast_like

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 requirement for all *_like op.  

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services