roywei commented on issue #8337: mx.autograd.grad works or fails depending on 
use of slices
URL: 
https://github.com/apache/incubator-mxnet/issues/8337#issuecomment-379423074
 
 
   @kpot  may I know what's the purpose of slice? let's say if you want a[0:2], 
how you want to use it?
   `a[0:4]` is a shallow copy of `a` , using slice in autograd may not be the 
idea way.
   In your case for OpenCL device, could you try to use symbolic gradient 
directly from nnvm? refer to 
[gradient](https://github.com/dmlc/nnvm/blob/master/src/pass/gradient.cc) and 
[test](https://github.com/dmlc/nnvm/blob/master/tests/python/compiler/test_optimizer.py#L33)
   
   ```
   a = mx.nd.array([1, 2, 3, 4], ctx=ctx)
   print(id(a))
   print(id(a[0:4]))
   
   >>>4387046120
   >>>4387048864

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


With regards,
Apache Git Services

Reply via email to