unienv_data.storages.pytorch¶
PytorchTensorStorage
¶
PytorchTensorStorage(single_instance_space: Union[BoxSpace[PyTorchArrayType, PyTorchDeviceType, PyTorchDtypeType, PyTorchRNGType], BinarySpace[PyTorchArrayType, PyTorchDeviceType, PyTorchDtypeType, PyTorchRNGType]], data: Union[Tensor, MemoryMappedTensor], mutable: bool = True)
Bases: SpaceStorage[PyTorchArrayType, PyTorchArrayType, PyTorchDeviceType, PyTorchDtypeType, PyTorchRNGType]
create
classmethod
¶
create(single_instance_space: BoxSpace[PyTorchArrayType, PyTorchDeviceType, PyTorchDtypeType, PyTorchRNGType], *, capacity: Optional[int], is_memmap: bool = True, cache_path: Optional[str] = None, multiprocessing: bool = False, memmap_existok: bool = True) -> PytorchTensorStorage
load_from
classmethod
¶
load_from(path: Union[str, PathLike], single_instance_space: Union[BoxSpace[PyTorchArrayType, PyTorchDeviceType, PyTorchDtypeType, PyTorchRNGType], BinarySpace[PyTorchArrayType, PyTorchDeviceType, PyTorchDtypeType, PyTorchRNGType]], *, is_memmap: bool = True, capacity: Optional[int] = None, read_only: bool = True, multiprocessing: bool = False, **kwargs) -> PytorchTensorStorage
extend_length
¶
extend_length(length: int) -> None
This is used by capacity = None storages to extend the length of the storage If this is called on a storage with a fixed capacity, we will simply ignore the call.
shrink_length
¶
shrink_length(length: int) -> None
This is used by capacity = None storages to shrink the length of the storage If this is called on a storage with a fixed capacity, we will simply ignore the call.