-
The API for Perhaps an API and/or a documentation update would be useful? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi - the reason this is different is because in
Because We may someday introduce a higher-level syntax for this: for example jax.lax.dynamic_slice(x, (start_index,), (length),) |
Beta Was this translation helpful? Give feedback.
Hi - the reason this is different is because in
dynamic_slice
, the start index is dynamic, but the slice size is static. There is no way to construct such a slice using NumPy's slice syntax; for example, if you have a dynamicstart_index
and a staticlength
, then you would have to write something like this:Because
end_index
is derived fromstart_index
, it is dynamic, and your indexing expression no longer has any way to statically determine the length!We may someday introduce a higher-level syntax for this: for example
pallas
has a dynamic slice object that makes dynamic-slice indexing look something likex[dslice(start_index, l…