haojin2 commented on a change in pull request #18027: Fix mixed binary
broadcast backward use none
URL: https://github.com/apache/incubator-mxnet/pull/18027#discussion_r407782501
##########
File path: src/operator/tensor/elemwise_binary_broadcast_op-inl.cuh
##########
@@ -58,8 +58,12 @@ BinaryBroadcastBackwardUseNone(const nnvm::NodeAttrs& attrs,
ctx.requested[0].get_space_typed<gpu, 1, char>(
Shape1(workspace_size * sizeof(index_t)), s);
if (out.shape_.Size() != 0) {
- Reduce<red::sum, NDim, DType, LOP>(s, lhs, req[0], workspace, out);
- Reduce<red::sum, NDim, DType, ROP>(s, rhs, req[1], workspace, out);
+ if (common::is_float(lhs.type_flag_)) {
+ Reduce<red::sum, NDim, DType, LOP>(s, lhs, req[0], workspace, out);
+ }
+ if (common::is_float(rhs.type_flag_)) {
+ Reduce<red::sum, NDim, DType, ROP>(s, rhs, req[1], workspace, out);
Review comment:
you're right, we need extra handling for that case.
----------------------------------------------------------------
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