Skip to content

torch.pow is inconsistent #26495

@zou3519

Description

@zou3519
import torch
empty = torch.randn([0])
tensor = torch.randn(2, 3)

result = torch.pow(tensor, 1, out=empty.clone())
RuntimeError: The size of tensor a (0) must match the size of tensor b (3) at non-singleton dimension 1

However, the following works:

import torch
empty = torch.randn([0])
tensor = torch.randn(2, 3)

result = torch.pow(tensor, 0, out=empty.clone())

cc @pbelevich

Metadata

Metadata

Assignees

No one assigned

    Labels

    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