You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/09/17 18:50:45 UTC

[GitHub] [incubator-mxnet] leezu opened a new issue #19170: Indexing memory sharing discrepancy

leezu opened a new issue #19170:
URL: https://github.com/apache/incubator-mxnet/issues/19170


   ## Description
   MXNet array indexing will only match numpy memory sharing in a few cases.
   
   ## To Reproduce
   Simple slice; mxnet matches numpy
   
   ``` python
   a = mx.np.ones((10,))
   b = a[:5]
   a[:] = 0
   print(a, b)  # [0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0.]
   ```
   
   Slice with step; mxnet diverges
   
   ``` python
   a = mx.np.ones((10,))
   b = a[:5:2]
   a[:] = 0
   print(a, b)  # [0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [1. 1. 1.]
   ```
   as numpy still shares memory between the arrays:
   
   ``` python
   a = np.ones((10,))
   b = a[:5:2]
   a[:] = 0
   print(a, b)  # [0. 0. 0. 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 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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org


[GitHub] [incubator-mxnet] szha commented on issue #19170: Indexing memory sharing discrepancy

Posted by GitBox <gi...@apache.org>.
szha commented on issue #19170:
URL: https://github.com/apache/incubator-mxnet/issues/19170#issuecomment-694438980


   the new python api standard includes read-only views


----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org