Skip to content

Multiplying a complex scalar to a non-complex tensor outputs tensor with only real values #33780

@anjali411

Description

@anjali411

torch.ones(2,2)*2
tensor([[2., 2.],
[2., 2.]])
torch.ones(2,2)*2j
tensor([[0., 0.],
[0., 0.]])
torch.tensor([[1,1],[1,1]], dtype=torch.complex64)2j
tensor([[(0.0000 + 2.0000j), (0.0000 + 2.0000j)],
[(0.0000 + 2.0000j), (0.0000 + 2.0000j)]], dtype=torch.complex64)
torch.ones(2,2)
(1+2j)
tensor([[1., 1.],
[1., 1.]])

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