Skip to content

__rpow__(self, other) OpInfo should not test the case where other is a Tensor #74616

@zou3519

Description

@zou3519

🐛 Describe the bug

After #74280 (cc @mruberry), the __rpow__ OpInfo has a sample input where other is a Tensor. This cannot happen during normal execution: to get to Tensor.__rpow__ a user does the following:

# self = some_tensor
# other = not_a_tensor
not_a_tensor ** some_tensor

If instead not_a_tensor is a Tensor, this ends up calling __pow__ in Python which will then handle the case.

Are there any legitimate cases where we do want this to happen?

Context

This caused some functorch tests to fail because we don't support the route where both self and other are Tensors. pytorch/pytorch also has some cryptic warning in that route:
image

but it's not clear to me if we want to support this or not.

Versions

pytorch main branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: testsIssues related to tests (not the torch.testing module)triagedThis 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