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 2018/03/30 23:33:13 UTC
[GitHub] piiswrong commented on issue #10347: [MXNET-257] Do not copy when casting as same type
piiswrong commented on issue #10347: [MXNET-257] Do not copy when casting as same type
URL: https://github.com/apache/incubator-mxnet/pull/10347#issuecomment-377645910
Numpy always copies.
```
>>> import numpy as np
>>> a = np.zeros((10,))
>>> c = a.astype(a.dtype)
>>> a[0] = 1
>>> a
array([ 1., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
>>> c
array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
```
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services