-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Labels
module: norms and normalizationtopic: docstopic categorytopic categorytriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
π The doc issue
The doc of linalg.vector_norm() says there is x parameter as shown below:
torch.linalg.vector_norm(x, ord=2, dim=None, keepdim=False, *, dtype=None, out=None) β Tensor
x (Tensor) β tensor, flattened by default, but this behavior can be controlled using dim.
Then, x parameter works and input parameter also works as shown below:
import torch
from torch import linalg
my_tensor = torch.tensor([-2., -1., 0., 1., 2., 3.])
linalg.vector_norm(x=my_tensor) # tensor(4.3589)
linalg.vector_norm(input=my_tensor) # tensor(4.3589)Suggest a potential alternative/fix
The doc of linalg.vector_norm() should say there is x or input parameter as shown below:
torch.linalg.vector_norm(x or input, ord=2, dim=None, keepdim=False, *, dtype=None, out=None) β Tensor
x or input (Tensor) β tensor, flattened by default, but this behavior can be controlled using dim.
Metadata
Metadata
Assignees
Labels
module: norms and normalizationtopic: docstopic categorytopic categorytriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module