Skip to content

Support __rlshift__ and __rrshift__ #58121

@asi1024

Description

@asi1024

🚀 Feature

Support torch.Tensor.{__rlshift__, __rrshift__}.
(cc: @mruberry, @rgommers, @emcastillo and @kmaehashi)

Motivation and Pitch

To enhance the compatibility with NumPy’s interface (c.f. #38349).

>>> 1 << numpy.array([1, 2, 3])
array([2, 4, 8])
>>> 1 << torch.tensor([1, 2, 3])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for <<: 'int' and 'Tensor'

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA request for a proper, new feature.module: python array apiIssues related to the Python Array APItriagedThis 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