DType

Contents

DType#

brainstate.typing.DType#

Alias for NumPy’s dtype type.

Used to represent data types of arrays in a clear and consistent manner.

Examples

>>> def create_array(shape: Shape, dtype: DType) -> jax.Array:
...     return jnp.zeros(shape, dtype=dtype)
>>>
>>> # Usage
>>> arr = create_array((3, 4), np.float32)