ATen icon indicating copy to clipboard operation
ATen copied to clipboard

Handle Advanced Indexing in ATen

Open zdevito opened this issue 6 years ago • 0 comments

@killeent @colesbury @gchanan This issue is just to track the progress on advanced indexing plans in ATen. To summarize our discussion, the initial idea is to add 'low-level' support for advanced indexing in the form of an operator like:

Tensor index(const char * format, TensorList inputs);

format is a string that describes indexing, ellispes, and colons: ".tt:", describes a indexing like [...,a_broadcastable_tensor, another_tensor,:] in python. Use of a 't' consumes one entry in inputs.

We will probably need to eventually support:

  • t a tensor, in TensorList
  • . ellispsis in python ...
  • : colon in python :
  • r a range specifier a:b, encoded as a tensor with 2 (3?) elements.

This will be the version of indexing wrapped by other interfaces, like PyTorch. We may eventually create a wrapper on this that uses objects more idomatic to C++.

zdevito avatar Oct 04 '17 18:10 zdevito