torchoutil.serialization.dump_fn module

dump(
obj: Any,
fpath: None | BinaryIO = None,
*args,
saving_backend: Literal['csv', 'json', 'h5py', 'numpy', 'pickle', 'safetensors', 'torch', 'torchaudio', 'yaml'] = 'torch',
**kwargs,
) str | bytes[source]
dump(
obj: Any,
fpath: str | Path | PathLike,
*args,
saving_backend: Literal['csv', 'json', 'h5py', 'numpy', 'pickle', 'safetensors', 'torch', 'torchaudio', 'yaml'] | None = 'torch',
**kwargs,
) str | bytes

Load from file using the correct backend.

save(
obj: Any,
fpath: str | Path | PathLike | None | BinaryIO = None,
*args,
saving_backend: Literal['csv', 'json', 'h5py', 'numpy', 'pickle', 'safetensors', 'torch', 'torchaudio', 'yaml'] | None = 'torch',
**kwargs,
) str | bytes[source]

Load from file using the correct backend.