pytorch/docs
Leo Wang f4bffb7461 [docs] fix autograd description on convex function case (#148658)
The sub-gradient of minimum norm is the least steep descent direction.

```python
import torch

x = torch.tensor([-2, -1, 0, 1, 2.], requires_grad=True)
torch.relu(x).sum().backward()
print(x.grad) # tensor([0., 0., 0., 1., 1.])

y = torch.tensor([-2, -1, 0, 1, 2.], requires_grad=True)
torch.abs(y).sum().backward()
print(y.grad) # tensor([-1., -1.,  0.,  1.,  1.])
```

(How can I request a reviewer? I don't have the button on the right)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/148658
Approved by: https://github.com/lezcano
2025-03-13 09:06:15 +00:00
..
cpp Add a stable TORCH_LIBRARY to C shim (#148124) 2025-03-11 19:12:46 +00:00
source [docs] fix autograd description on convex function case (#148658) 2025-03-13 09:06:15 +00:00
.gitignore
libtorch.rst Add ROCm documentation to libtorch (C++) reST. (#136378) 2024-09-25 02:30:56 +00:00
make.bat
Makefile [ONNX] Update images and APIs to onnx_dynamo.rst (#144358) 2025-01-08 21:44:43 +00:00
README.md
requirements.txt Revert "Fix deprecated pytorch_sphinx_theme editable installation (#145347)" 2025-01-23 20:06:07 +00:00

Please see the Writing documentation section of CONTRIBUTING.md for details on both writing and building the docs.