pytorch
65beff5a - Dispatch torch.norm to linalg.vector_norm and linalg.matrix_norm (#81761)

Commit
2 years ago
Dispatch torch.norm to linalg.vector_norm and linalg.matrix_norm (#81761) `torch.norm` is very odd. Some notable issues are: - The default value of `"fro"` in `torch.norm` has an odd behaviour when `dim=None`. This is handled in the new dispatch - The treatment of the `dtype` argument in `torch.norm` was completely wrong. This should fix it - Some `out=` variants in the previous implementation were also wrong. This should fix those. - This new dispatch should make some paths much faster. For example, `torch.norm(x)` where `x` is complex. I'll try to make the changes in these PRs as incremental as possible as this is a tricky one. Pull Request resolved: https://github.com/pytorch/pytorch/pull/81761 Approved by: https://github.com/ngimel
Author
Committer
Parents
Loading