-
Couldn't load subscription status.
- Fork 38
Open
Description
The array API standard seems to support negative step.
The basic slice syntax is
i:j:kwhereiis the starting index,jis the stopping index, andkis the step (k != 0).
But array-api-compat.torch tensors do not:
from array_api_compat import torch
x = torch.arange(10)
x[::-1] # ValueError: step must be greater than zeroAdding support for negative step would be appreciated! (In the meantime, I can use flip.) Thanks for considering it.