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/01/16 21:55:15 UTC

[GitHub] [incubator-mxnet] haojin2 commented on issue #17342: [bug] Incorrect Indexed Assignment

haojin2 commented on issue #17342: [bug] Incorrect Indexed Assignment
URL: https://github.com/apache/incubator-mxnet/issues/17342#issuecomment-575365086
 
 
   @kshitij12345 This has been addressed in the new `np` module:
   ```python
   from mxnet import np, npx
   npx.set_np()
   import numpy as onp
   
   def test_replace(array_constructor):
       array = [[0.0, 2]]
       x = array_constructor(array)
       zero_mask = x == 0.0
       print(zero_mask)
       x[zero_mask] = 1e-6
       print(x)
   
   test_replace(np.array)
   print('*' * 8)
   test_replace(onp.array)
   ```
   running this on the latest master:
   ```
   [[ True False]]
   [[1.e-06 2.e+00]]
   ********
   [[ True False]]
   [[1.e-06 2.e+00]]
   ```

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