get_key_data#
- class brainstate.random.get_key_data#
Get the current global random key as raw
uint32[2]data.This is the legacy-interop counterpart of
get_key(). It returns the underlying key data (a 2-elementuint32array) extracted from the current typed key viajax.random.key_data(). This is useful when interfacing with code that still expects the olduint32[2]key representation.- Return type:
Array
Examples
>>> import brainstate >>> import jax.random as jr >>> brainstate.random.set_key(jr.key(11)) >>> data = brainstate.random.get_key_data() >>> print(data.shape, data.dtype) (2,) uint32