ZheyuYe commented on pull request #18089:
URL: https://github.com/apache/incubator-mxnet/pull/18089#issuecomment-628374562


   It seems that this operation currently only supports floating type. In 
addition, it would be great if the data types of indices can be extended to 
`np.ndarray` instead of only `tuple` and `list` as
   ```python
   import mxnet as mx
   a = mx.np.zeros((2,6))
   val = mx.np.arange(6)
   x = [1,0,0,0,0,0]
   y = [0,2,3,4,0,1]
   # indices = [list, list]
   mx.npx.index_add(a, val, [x, y])
   # indices = (list, list)
   mx.npx.index_add(a, val, (x, y))
   # indices = [np.ndarray, np.ndarray]
   x = mx.np.array(x).astype('int32')
   y = mx.np.array(y).astype('int32')
   mx.npx.index_add(a, val, [x, y])
   
   >>> MXNetError: MXNetError: Invalid Parameter format for ind expect tuple of 
<Shape(tuple)> 
   but value='[array([1, 0, 0, 0, 0, 0], dtype=int32), array([0, 2, 3, 4, 0, 
1], dtype=int32)]', in 
   operator _npx_index_add(name="", ind="[array([1, 0, 0, 0, 0, 0], 
dtype=int32), array([0, 2, 3, 4, 0, 1], dtype=int32)]")
   
   
   ```


----------------------------------------------------------------
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:
[email protected]


Reply via email to