Skip to content

unienv_data.storages.flattened

FlattenedStorage

FlattenedStorage(single_instance_space: Space[BatchT, BDeviceType, BDtypeType, BRNGType], inner_storage: SpaceStorage[BArrayType, BArrayType, BDeviceType, BDtypeType, BRNGType], inner_storage_path: Union[str, PathLike], cache_filename: Optional[Union[str, PathLike]] = None)

Bases: SpaceStorage[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

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[BatchT, BDeviceType, BDtypeType, BRNGType], inner_storage_cls: Type[SpaceStorage[BArrayType, BArrayType, BDeviceType, BDtypeType, BRNGType]], *args, capacity: Optional[int] = None, cache_path: Optional[str] = None, multiprocessing: bool = False, inner_storage_kwargs: Dict[str, Any] = {}, **kwargs) -> FlattenedStorage[BatchT, BArrayType, BDeviceType, BDtypeType, BRNGType]

load_from classmethod

load_from(path: Union[str, PathLike], single_instance_space: Space[BatchT, BDeviceType, BDtypeType, BRNGType], *, capacity: Optional[int] = None, read_only: bool = True, multiprocessing: bool = False, **kwargs) -> FlattenedStorage[BatchT, BArrayType, BDeviceType, BDtypeType, BRNGType]

extend_length

extend_length(length)

shrink_length

shrink_length(length)

get_flattened

get_flattened(index)

get

get(index)

set_flattened

set_flattened(index, value)

set

set(index, value)

clear

clear()

dumps

dumps(path)

close

close()