Skip to content

torch.pow generates incorrect result for a vectorized op for complex dtype #36730

@anjali411

Description

@anjali411
m1 = torch.rand(100, 100, dtype=dtype, device=device) + 0.5
# base - tensor, exponent - number
# contiguous
num = -2.8
res1 = torch.pow(m1[4], num)
res2 = res1.clone().zero_()
for i in range(res2.size(0)):
   res2[i] = pow(m1[4][i], num)
self.assertEqual(res1, res2) # should be True, returns False

cc @ezyang @anjali411 @dylanbespalko

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: complexRelated to complex number support in PyTorchtriagedThis 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