Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The doc of linalg.vector_norm() should not say ord parameter accepts the str value fro or nuc #136563

Open
hyperkai opened this issue Sep 24, 2024 · 2 comments
Labels
module: norms and normalization topic: docs topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@hyperkai
Copy link

πŸ“š The doc issue

The doc of linalg.vector_norm() says ord parameter accepts the str value fro or nuc as shown below:

ord (int, float, inf, -inf, 'fro', 'nuc', optional) – order of norm. Default: 2

But ord parameter with fro or nuc doesn't work as shown below:

import torch
from torch import linalg

my_tensor = torch.tensor([[-2., -1., 0.],
                          [1., 2., 3.]])
linalg.vector_norm(input=my_tensor, ord='fro') # Error
                                  # ↑ ↑ ↑ ↑ ↑
linalg.vector_norm(input=my_tensor, ord='nuc') # Error
                                  # ↑ ↑ ↑ ↑ ↑

TypeError: linalg_vector_norm(): argument 'ord' must be Number, not str

TypeError: linalg_vector_norm(): argument 'ord' must be Number, not str

Suggest a potential alternative/fix

The doc of linalg.vector_norm() should not say ord parameter accepts the str value fro or nuc as shown below:

ord (int, float, inf, -inf, optional) – order of norm. Default: 2

@ezyang ezyang added triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module module: norms and normalization topic: docs topic category labels Sep 24, 2024
@ezyang
Copy link
Contributor

ezyang commented Sep 24, 2024

Send us a PR?

@wwwbai
Copy link

wwwbai commented Oct 26, 2024

hey can I take care of this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: norms and normalization topic: docs topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

3 participants