We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For example torch.add says
add(value) β Tensor add(other, *, value=1) -> Tensor See torch.add()
But indeed the value flag doesn't exist.
>>> import torch >>> a = torch.randn(1, 3) >>> b = torch.randn(1, 3) >>> a tensor([[-0.5835, -0.1405, -1.8119]]) >>> b tensor([[ 0.8623, -1.3727, 1.5434]]) >>> a.add(b) tensor([[ 0.2789, -1.5132, -0.2685]]) >>> a.add(b, 1) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: add() takes 1 positional argument but 2 were given >>> a.add(b, 2) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: add() takes 1 positional argument but 2 were given >>> a.add(b, valu=2) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: add() got an unexpected keyword argument 'valu' >>> a.add(b, value=2) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: add() got an unexpected keyword argument 'value' >>> a.add(b, 2) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: add() takes 1 positional argument but 2 were given
Instead one has to use alpha as a flag.
alpha
>>> import torch >>> a = torch.randn(1, 3) >>> b = torch.randn(1, 3) >>> a.add(a, alpha=3.0) tensor([[ 3.3190, -0.4248, -3.6609]])
There are many other instances of this in the documentation.
The text was updated successfully, but these errors were encountered:
Closing in favor of #19200.
Sorry, something went wrong.
No branches or pull requests
π Documentation
For example torch.add says
But indeed the value flag doesn't exist.
Instead one has to use
alpha
as a flag.There are many other instances of this in the documentation.
The text was updated successfully, but these errors were encountered: