Skip to content

unienv_data.storages.backend_compat

WrapperBatchT module-attribute

WrapperBatchT = TypeVar('WrapperBatchT')

WrapperBArrayT module-attribute

WrapperBArrayT = TypeVar('WrapperBArrayT')

WrapperBDeviceT module-attribute

WrapperBDeviceT = TypeVar('WrapperBDeviceT')

WrapperBDtypeT module-attribute

WrapperBDtypeT = TypeVar('WrapperBDtypeT')

WrapperBRngT module-attribute

WrapperBRngT = TypeVar('WrapperBRngT')

ToBackendOrDeviceStorage

ToBackendOrDeviceStorage(single_instance_space: Space[WrapperBatchT, WrapperBDeviceT, WrapperBDtypeT, WrapperBRngT], inner_storage: SpaceStorage[BatchT, BArrayType, BDeviceType, BDtypeType, BRNGType], inner_storage_path: Union[str, PathLike], cache_filename: Optional[Union[str, PathLike]] = None)

Bases: SpaceStorage[WrapperBatchT, WrapperBArrayT, WrapperBDeviceT, WrapperBDtypeT, WrapperBRngT], Generic[WrapperBatchT, WrapperBArrayT, WrapperBDeviceT, WrapperBDtypeT, WrapperBRngT, BatchT, BArrayType, BDeviceType, BDtypeType, BRNGType]

single_file_ext class-attribute instance-attribute

single_file_ext = None

inner_storage instance-attribute

inner_storage = inner_storage

inner_storage_path instance-attribute

inner_storage_path = inner_storage_path

inner_backend instance-attribute

inner_backend = inner_backend

inner_device instance-attribute

inner_device = inner_device

current_backend instance-attribute

current_backend = current_backend

current_device instance-attribute

current_device = current_device

cache_filename property

cache_filename: Optional[Union[str, PathLike]]

is_mutable property

is_mutable: bool

is_multiprocessing_safe property

is_multiprocessing_safe: bool

capacity property

capacity: Optional[int]

backend property

backend: ComputeBackend[BArrayType, BDeviceType, BDtypeType, BRNGType]

device property

device: Optional[BDeviceType]

single_instance_space instance-attribute

single_instance_space = single_instance_space

create classmethod

create(single_instance_space: Space[WrapperBatchT, WrapperBDeviceT, WrapperBDtypeT, WrapperBRngT], inner_storage_cls: Type[SpaceStorage[BatchT, BArrayType, BDeviceType, BDtypeType, BRNGType]], *args, capacity: Optional[int] = None, cache_path: Optional[str] = None, multiprocessing: bool = False, backend: Optional[ComputeBackend[BArrayType, BDeviceType, BDtypeType, BRNGType]] = None, device: Optional[BDeviceType] = None, inner_storage_kwargs: Dict[str, Any] = {}, **kwargs) -> ToBackendOrDeviceStorage[WrapperBatchT, WrapperBArrayT, WrapperBDeviceT, WrapperBDtypeT, WrapperBRngT, BatchT, BArrayType, BDeviceType, BDtypeType, BRNGType]

load_from classmethod

load_from(path: Union[str, PathLike], single_instance_space: Space[Any, BDeviceType, BDtypeType, BRNGType], *, capacity: Optional[int] = None, read_only: bool = True, multiprocessing: bool = False, **kwargs) -> Union[ToBackendOrDeviceStorage[WrapperBatchT, WrapperBArrayT, WrapperBDeviceT, WrapperBDtypeT, WrapperBRngT, BatchT, BArrayType, BDeviceType, BDtypeType, BRNGType], SpaceStorage[WrapperBatchT, WrapperBArrayT, WrapperBDeviceT, WrapperBDtypeT, WrapperBRngT]]

extend_length

extend_length(length)

shrink_length

shrink_length(length)

get

get(index)

set

set(index, value)

clear

clear()

dumps

dumps(path)

close

close()

data_to

data_to(data: Any, source_backend: Optional[ComputeBackend[BArrayType, BDeviceType, BDtypeType, BRNGType]] = None, target_backend: Optional[ComputeBackend[WrapperBArrayT, WrapperBDeviceT, WrapperBDtypeT, WrapperBRngT]] = None, target_device: Optional[WrapperBDeviceT] = None)