torchoutil
torchoutil.serialization.torch module
-
dump_torch(
- obj: object,
- f: str | ~os.PathLike | ~typing.BinaryIO | ~typing.IO[bytes] | None = None,
- pickle_module: ~typing.Any = <module 'pickle' from '/home/docs/.asdf/installs/python/3.8.20/lib/python3.8/pickle.py'>,
- pickle_protocol: int = 2,
- _use_new_zipfile_serialization: bool = True,
- _disable_byteorder_record: bool = False,
- *,
- overwrite: bool = True,
- make_parents: bool = True,
) → bytes[source]
-
load_torch(
- f: str | PathLike | BinaryIO | IO[bytes],
- map_location: Callable[[Storage, str], Storage] | device | str | Dict[str, str] | None = None,
- pickle_module: Any | None = None,
- *,
- weights_only: bool = False,
- mmap: bool | None = None,
- **pickle_load_args: Any,
) → Any[source]
-
to_torch(
- obj: object,
- f: str | ~os.PathLike | ~typing.BinaryIO | ~typing.IO[bytes] | None = None,
- pickle_module: ~typing.Any = <module 'pickle' from '/home/docs/.asdf/installs/python/3.8.20/lib/python3.8/pickle.py'>,
- pickle_protocol: int = 2,
- _use_new_zipfile_serialization: bool = True,
- _disable_byteorder_record: bool = False,
- *,
- overwrite: bool = True,
- make_parents: bool = True,
) → bytes[source]