get (indexing) to get a slice removing the axis (or axes) indexed
slice (indexing with a range) to get a slice that retains the axis indexed
gather (index with a list of ints) [not yet checked in]
This can be accomplished in diffkt as Z.gather(li, axis = 1).gather(lj, axis = 2) but at the expense of constructing a possibly large intermediate tensor.
It would be nice to have a generalized indexing operation in which each position could be any of
"all" like Python's :
A single integer value, which means the axis would be removed
A range of values, which would retain the axis
A list of integers
This would allow a direct translation of the idiomatic Python code, and possibly the avoidance of large intermediate tensors.
Right now we have
get
(indexing) to get a slice removing the axis (or axes) indexedslice
(indexing with a range) to get a slice that retains the axis indexedgather
(index with a list of ints) [not yet checked in]This can be accomplished in diffkt as
Z.gather(li, axis = 1).gather(lj, axis = 2)
but at the expense of constructing a possibly large intermediate tensor.It would be nice to have a generalized indexing operation in which each position could be any of
:
This would allow a direct translation of the idiomatic Python code, and possibly the avoidance of large intermediate tensors.