Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/pytorch/tutorials
/ unpack
Function
unpack
intermediate_source/autograd_saved_tensors_hooks_tutorial.py:232–233 ·
view source on GitHub ↗
(x)
Source
from the content-addressed store, hash-verified
230
return
len(storage) - 1
231
232
def
unpack(x):
233
return
storage[x]
234
235
x = torch.randn(5, requires_grad=True)
236
with
torch.autograd.graph.saved_tensors_hooks(pack, unpack):
Callers
nothing calls this directly
Calls
1
f
Function · 0.70
Tested by
no test coverage detected