You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/03/24 21:23:30 UTC

[GitHub] [incubator-mxnet] sxjscience opened a new issue #17901: [Numpy Extension] Move stop_gradient to npx

sxjscience opened a new issue #17901: [Numpy Extension] Move stop_gradient to npx
URL: https://github.com/apache/incubator-mxnet/issues/17901
 
 
   ## Description
   `stop_gradient` is very essential for building the network. Currently, there is no `stop_gradient` functionality in the numpy interface.
   
   The workaround I used is:
   
   ```python
   
   @use_np
   def stop_gradient(F, x):
       return F.stop_gradient(x.as_nd_ndarray()).as_np_ndarray()
   ```
   I think it should be safe to directly register  `stop_gradient` in npx.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services