access2rohit commented on a change in pull request #17882:
URL: https://github.com/apache/incubator-mxnet/pull/17882#discussion_r445872765



##########
File path: src/operator/tensor/broadcast_reduce_op.h
##########
@@ -1125,8 +1221,14 @@ inline void BroadcastComputeImpl(const nnvm::NodeAttrs& 
attrs,
   using namespace mshadow::expr;
   using namespace mxnet_op;
   mxnet::TShape src_shape, dst_shape;
+  // combines 2 or more consecutive broadcast/non-broadcast axes together
+  // e.g. (3,4,1,1,5,1,6,7) (2,3,5) (5,10,9) -> (3*4,1*1,5,1,6*7) (1,3) (5*10, 
9)
+  //      -> (12,1,5,1,42) (1,3) (50, 9)
+  //      and this is the new input for broadcast_kernel whose total
+  //      num of dimensions cannot be greater than 5(throws an error 
otherwise).
   BroadcastReduceShapeCompact(outputs[0].shape_, small, &dst_shape, 
&src_shape);
   Stream<xpu> *s = ctx.get_stream<xpu>();
+  bool isCPU = ctx.run_ctx.get_ctx().dev_type == Context::kCPU;

Review comment:
       good point .. let me try it




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


Reply via email to