MCPcopy Create free account
hub / github.com/pytorch/pytorch / persistent_load

Function persistent_load

torch/serialization.py:1118–1124  ·  view source on GitHub ↗
(saved_id)

Source from the content-addressed store, hash-verified

1116 deserialized_objects: Dict[int, Any] = {}
1117
1118 def persistent_load(saved_id):
1119 if isinstance(saved_id, tuple):
1120 # Ignore containers that don't have any sources saved
1121 if all(saved_id[1:]):
1122 _check_container_source(*saved_id)
1123 return saved_id[0]
1124 return deserialized_objects[int(saved_id)]
1125
1126 with closing(tarfile.open(fileobj=f, mode='r:', format=tarfile.PAX_FORMAT)) as tar, \
1127 mkdtemp() as tmpdir:

Callers

nothing calls this directly

Calls 9

_data_ptrMethod · 0.95
isinstanceFunction · 0.85
_check_container_sourceFunction · 0.85
_maybe_decode_asciiFunction · 0.85
castFunction · 0.85
restore_locationFunction · 0.85
_element_sizeMethod · 0.80
load_tensorFunction · 0.70
allFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…