Skip to content

[feature request] torch.hypot #22764

@vadimkantorov

Description

@vadimkantorov

torch.stft returns real and imaginary components as the last dimension. Two very frequent functions to consume it are: abs and angle (in NumPy). Abs is similar to regular np.hypot, so meanwhile complex tensor support is not developed, hypot could do abs's job.

NumPy also has a hypot, although it accepts two arrays. We may have two versions: one accepting two arrays, another accepting only one array and a dim. Essentially, hypot is a version of norm, specialized for two element vectors only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNot as big of a feature, but technically not a bug. Should be easy to fixmodule: numpyRelated to numpy support, and also numpy compatibility of our operatorstriagedThis 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