pytorch/docs/source/notes
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
..
amp_examples.rst Update document for autocast on CPU (#135299) 2024-09-13 09:11:47 +00:00
autograd.rst [docs] fix autograd description on convex function case (#148658) 2025-03-13 09:06:15 +00:00
broadcasting.rst
cpu_threading_runtimes.svg
cpu_threading_torchscript_inference.rst
cpu_threading_torchscript_inference.svg
cuda.rst Documents torch.cuda.MemPool API (#148374) 2025-03-06 23:18:43 +00:00
custom_operators.rst Redirect the custom ops landing page :D (#139634) 2024-11-04 22:25:15 +00:00
ddp.rst Update DDP dynamo debug docs (#118295) 2024-01-29 14:58:26 +00:00
extending.func.rst
extending.rst [doc] fix grammar in "Extending Torch" (#140209) 2024-11-13 05:34:43 +00:00
faq.rst
fsdp.rst [docs] start a new FSDP notes doc (#117323) 2024-01-22 15:46:35 +00:00
get_start_xpu.rst Add note to get start xpu (#148168) 2025-03-05 18:11:14 +00:00
gradcheck.rst
hip.rst [ROCm] set hipblas workspace (#138791) 2024-10-29 01:37:55 +00:00
large_scale_deployments.rst
modules.rst Fix to modules.rst: indent line with activation functions (#139667) 2024-11-08 01:12:52 +00:00
mps.rst
multiprocessing.rst
numerical_accuracy.rst Add option to configure reduced precision math backend for SDPA (#135964) 2024-09-24 07:11:38 +00:00
randomness.rst Fix typo in Reproducibility docs (#141341) 2024-11-26 16:53:26 +00:00
serialization.rst Make record/storage alignment in torch.save configurable (#147788) 2025-03-06 12:04:46 +00:00
windows.rst