Skip to content

Dict

lerax.space.Dict

Bases: AbstractSpace[OrderedDict[str, Any], None]

A dictionary of spaces.

Attributes:

Name Type Description
spaces OrderedDict[str, AbstractSpace]

An ordered dictionary mapping keys to component spaces.

Parameters:

Name Type Description Default
spaces Mapping[str, AbstractSpace]

A mapping from keys to component spaces.

required

spaces instance-attribute

spaces: OrderedDict[str, AbstractSpace] = OrderedDict(
    spaces
)

shape property

shape: None

flat_size property

flat_size: int

__contains__

__contains__(x: Any) -> bool

__init__

__init__(spaces: Mapping[str, AbstractSpace])

canonical

canonical() -> OrderedDict[str, Any]

sample

sample(
    *, key: Key, mask: None = None
) -> OrderedDict[str, Any]

contains

contains(x: Any) -> Bool[Array, '']

__eq__

__eq__(other: object) -> bool

__repr__

__repr__() -> str

__hash__

__hash__() -> int

flatten_sample

flatten_sample(
    sample: OrderedDict[str, Any],
) -> Float[Array, " size"]

__getitem__

__getitem__(index: str) -> AbstractSpace

__len__

__len__() -> int