apaleyes commented on a change in pull request #7041: Implementation of cbrt 
and rcbrt operators
URL: https://github.com/apache/incubator-mxnet/pull/7041#discussion_r131150370
 
 

 ##########
 File path: src/operator/mshadow_op.h
 ##########
 @@ -604,6 +604,36 @@ struct reciprocal_square_root_grad {
   }
 };
 
+/*!\ \brief used for generate element cbrt */
+struct cube_root {
+  template<typename DType>
+  MSHADOW_XINLINE static DType Map(DType a) {
+    return DType(cbrtf(a));
+  }
+};
+
+struct cube_root_grad {
+  template<typename DType>
+  MSHADOW_XINLINE static DType Map(DType a) {
+    return DType(DType(1.0f) / ( DType(3.0f) * a * a));
 
 Review comment:
   @piiswrong any insight here? Thanks!
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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