Shape

Contents

Shape#

brainstate.typing.Shape#

Type for array shapes as sequences of integers.

Represents the shape of an array as a sequence of dimension sizes. More restrictive than Size as it requires a sequence.

Examples

>>> # 2D array shape
>>> matrix_shape: Shape = (10, 20)
>>>
>>> # 3D array shape
>>> tensor_shape: Shape = (5, 10, 15)
>>>
>>> # 1D array shape (note: still needs to be a sequence)
>>> vector_shape: Shape = (100,)