Skip to content

torch.abs(complex) is divergent from NumPy on vectorized NaN values  #41246

@mruberry

Description

@mruberry
c = complex(float('nan'), float('inf'))

l = [c] * 300
t = torch.tensor(l)
torch.abs(t)

will produce a tensor with mostly nan values. NumPy, however, and non-vectorized torch.abs, will produce inf values.

cc @ezyang @anjali411 @dylanbespalko

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: NaNs and InfsProblems related to NaN and Inf handling in floating pointmodule: 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