yifeim opened a new issue #17786: pick with multi-dimensional indices
URL: https://github.com/apache/incubator-mxnet/issues/17786
 
 
   ## Description
   - Support `pick(data, [[0,1,2],[1,2,3]]) = [[data[0,0], data[0,1], 
data[0,2], [data[1,1], data[1,2], data[1,3]]`.
   - As a side note, add a "fill-value" mode to out-of-bound indices. This 
seems to be a logical replacement to the original "raise"-mode proposal, which 
is "not supported yet".
   - The new functions should also support `axis` parameter in backward 
compatible ways.
   
   ## References
   - Multi-dimensional `take` is already implemented as `take(data, 
[[0,3],[-1,-2]]) = [[data[0], data[3]], [data[-1], data[-2]]`.
   - Since `pick` is modeled as `batch_take`, the extension seems natural.
   - The expected result for a fill-value mode could be verified as
   ```
   F.pick(data, indices, mode='fill', fill_value=fv) = F.where(
     (indices>=0) * (indices<data.shape_array().slice_axis(axis=0, begin=-1, 
end=None)),
     F.pick(data, indices),
     F.ones_like(indices.astype(data.dtype))*fv)
   ```

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


With regards,
Apache Git Services

Reply via email to