Skip to content

Multi Discrete

lerax.space.MultiDiscrete

Bases: AbstractSpace[Int[Array, ' n'], None]

Cartesian product of discrete spaces.

Attributes:

Name Type Description
nvec tuple[int, ...]

The number of discrete values for each dimension.

Parameters:

Name Type Description Default
nvec tuple[int, ...]

The number of discrete values for each dimension.

required

nvec instance-attribute

nvec: tuple[int, ...] = nvec

shape property

shape: tuple[int, ...]

flat_size property

flat_size: int

__contains__

__contains__(x: Any) -> bool

__init__

__init__(nvec: tuple[int, ...])

canonical

canonical() -> Int[Array, ' n']

sample

sample(*, key: Key, mask: None = None) -> Int[Array, ' n']

contains

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

__eq__

__eq__(other: object) -> bool

__repr__

__repr__() -> str

__hash__

__hash__() -> int

flatten_sample

flatten_sample(
    sample: Int[ArrayLike, " n"],
) -> Float[Array, " n"]