Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/pytorch/tutorials
/ zeroing_out_gradients.py
File
zeroing_out_gradients.py
recipes_source/recipes/zeroing_out_gradients.py:None–None ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
1
""
"
2
Zeroing out gradients in PyTorch
3
================================
4
It is beneficial to zero out gradients when building a neural network.
Callers
nothing calls this directly
Calls
3
step
Method · 0.80
Net
Class · 0.70
backward
Method · 0.45
Tested by
no test coverage detected