Skip to content

tensorplay.serialization

Functions

load() [source]

python
load(f, map_location=None, pickle_module=<module 'pickle' from 'E:\\Miniconda\\Lib\\pickle.py'>, **pickle_load_args)

Loads an object saved with tensorplay.save() from a file. Supports .tpm, .safetensors, and .pth (via torch).

Args

  • f: a file-like object (has to implement read, readline, tell, and seek), or a string containing a file name.
  • map_location: a function, torch.device, string or a dict specifying how to remap storage locations
  • pickle_module: module used for unpickling metadata and objects
  • pickle_load_args: (optional) keyword arguments passed to pickle_module.load

save() [source]

python
save(obj, f, pickle_module=<module 'pickle' from 'E:\\Miniconda\\Lib\\pickle.py'>, pickle_protocol=2, _use_new_zipfile_serialization=True)

Saves an object to a disk file. Supports .tpm (TensorPlay Model) and .safetensors (Safetensors).

Released under the Apache 2.0 License.

📚DeepWiki