Skip to content

torch.transpose is divergent from np.transpose #50275

@mruberry

Description

@mruberry

PyTorch's torch.transpose swaps two dimensions in a tensor, while NumPy's np.transpose permutes the dimensions of its input, like PyTorch's torch.Tensor.permute does.

The NumPy community seems uninterested in offering a "permute" alias for np.transpose.

Numpy's np.transpose is a top 100 NumPy function, and torch.transpose is also popular with thousands of uses within Facebook.

cc @mruberry @rgommers @heitorschueroff

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: deprecationmodule: numpyRelated to numpy support, and also numpy compatibility of our operatorstriagedThis 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