ZhennanQin commented on a change in pull request #16025: Numpy add numpy op 
left_shift and right_shift
URL: https://github.com/apache/incubator-mxnet/pull/16025#discussion_r328401560
 
 

 ##########
 File path: src/operator/numpy/np_elemwise_broadcast_op.cc
 ##########
 @@ -144,5 +165,21 @@ 
MXNET_OPERATOR_REGISTER_NP_BINARY_SCALAR(_backward_npi_rcopysign_scalar)
 .set_attr<FCompute>("FCompute<cpu>",
                     BinaryScalarOp::Backward<cpu, mshadow_op::rcopysign_grad>);
 
+MXNET_OPERATOR_REGISTER_NP_BINARY_SCALAR(_npi_left_shift_scalar)
+.set_attr<FCompute>("FCompute<cpu>", BitScalarCompute<cpu, 
mshadow_op::left_shift>)
+.set_attr<nnvm::FGradient>("FGradient", MakeZeroGradNodes);
 
 Review comment:
   I agree with removing backward implementation for now. Please remove 
`FGradient` registration, because `MakeZeroGradNodes` will provide 0 gradient, 
which is unexpected.

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