Skip to content

unienv_data.storages.npz_storage

NPZStorage

NPZStorage(single_instance_space: BoxSpace[BArrayType, BDeviceType, BDtypeType, BRNGType], compressed: bool, cache_filename: Union[str, PathLike], mutable: bool = True, capacity: Optional[int] = None, length: int = 0)

Bases: ListStorageBase[BArrayType, BArrayType, BDeviceType, BDtypeType, BRNGType]

compressed instance-attribute

compressed = compressed

single_file_ext class-attribute instance-attribute

single_file_ext = None

capacity instance-attribute

capacity = capacity

cache_filename property

cache_filename: Union[str, PathLike]

is_multiprocessing_safe property

is_multiprocessing_safe: bool

is_mutable instance-attribute

is_mutable = mutable

backend property

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

device property

device: Optional[BDeviceType]

single_instance_space instance-attribute

single_instance_space = single_instance_space

file_ext instance-attribute

file_ext = file_ext

length instance-attribute

length = length if capacity is None else capacity

create classmethod

create(single_instance_space: BoxSpace[BArrayType, BDeviceType, BDtypeType, BRNGType], *args, compressed: bool = True, capacity: Optional[int] = None, cache_path: Optional[str] = None, multiprocessing: bool = False, **kwargs) -> NPZStorage[BArrayType, BDeviceType, BDtypeType, BRNGType]

load_from classmethod

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

get_from_file

get_from_file(filename: str) -> BArrayType

set_to_file

set_to_file(filename: str, value: BArrayType)

dumps

dumps(path)

close

close()

extend_length

extend_length(length)

shrink_length

shrink_length(length)

get

get(index)

set

set(index, value)

clear

clear()

get_single

get_single(index: int) -> BatchT

set_single

set_single(index: int, value: BArrayType)