MCPcopy Create free account
hub / github.com/Pints-AI/1.5-Pints / __init__

Method __init__

lit_gpt/utils_old.py:296–301  ·  view source on GitHub ↗
(self, tensor, saver, protocol_version=5)

Source from the content-addressed store, hash-verified

294
295class SavingProxyForTensor:
296 def __init__(self, tensor, saver, protocol_version=5):
297 self.protocol_version = protocol_version
298 self.reduce_ret_fn, (storage, *other_reduce_args) = tensor.__reduce_ex__(protocol_version)
299 assert isinstance(storage, torch.storage.TypedStorage), "Please check for updates"
300 storage_proxy = SavingProxyForStorage(storage, saver, protocol_version=protocol_version)
301 self.reduce_args = (storage_proxy, *other_reduce_args)
302
303 def __reduce_ex__(self, protocol_version):
304 if protocol_version != self.protocol_version:

Callers

nothing calls this directly

Calls 2

__reduce_ex__Method · 0.45

Tested by

no test coverage detected