barry-jin commented on a change in pull request #20587:
URL: https://github.com/apache/incubator-mxnet/pull/20587#discussion_r726724944
##########
File path: src/common/cuda/rtc/backward_functions-inl.h
##########
@@ -426,6 +426,48 @@ copysign_grad(const DType val,
return (val >= 0 && val2 >= 0) || (val < 0 && val2 < 0) ? 1 : -1;
}
+template <typename DType, typename DType2>
+__device__ inline mixed_type<DType, DType2>
+bitwise_left_shift_grad(const DType val,
+ const DType2 val2) {
+ return op::power(static_cast<DType>(2), val2);
+}
+
+template <typename DType, typename DType2>
+__device__ inline mixed_type<DType, DType2>
+bitwise_left_shift_rgrad(const DType val,
+ const DType2 val2) {
+ return val * op::power(static_cast<DType>(2), val2) *
op::log(static_cast<type>(2));
Review comment:
Thanks for pointing it out. Here `type` should be `mixed_type<DType,
DType2>`.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]