Closed
Description
If you want to index a tensor currently your only choice is strided_slice
or slice
, neither of which have good APIs.
I'd like to create an indexing API that supports point indices, slices, strided slices, ellipses, all, and newaxis. This isn't particularly hard to do by using strided_slice
, I already have a similar Kotlin API I can port. This will also port well to the Kotlin API, especially with the rangeTo
operator.
I'd like the usage to look something like:
tf.slice(x, Index.point(0), Index.all, Index.slice(0, 5, 2) // [0, :, 0:5::2]
tf.slice(x, Index.newaxis, Index.point(10, true), Index.elipses) // [tf.newaxis, 10:11, ...]
This would cover the assign variants, too.
Metadata
Metadata
Assignees
Labels
No labels