Skip to content

Remove support for multiple ellipses in slicing #59787

@pmeier

Description

@pmeier

The array API specification stipulates that the slice for nd tensors shall contain at most one ellipsis (...). PyTorch allows an arbitrary number:

import torch

a = torch.rand((1, 2, 3, 4, 5))
a[..., 0, ..., ...]

Not only is this behavior undocumented, it also makes no sense: what dimension would the 0 applied to in the above example?

cc @mruberry @rgommers @pmeier @asmeurer @leofang

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: advanced indexingRelated to x[i] = y, index functionsmodule: deprecationmodule: python array apiIssues related to the Python Array APIneeds designWe want to add this feature but we need to figure out how firsttriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions