brainstate.util module#
Dict Operation#
Flatten a nested mapping into a flat mapping with tuple or string keys. |
|
Unflatten a mapping by converting tuple/string keys back to nested structure. |
|
A pytree-like nested mapping structure for organizing hierarchical data. |
|
A pytree-like structure that contains a |
Filter Operation#
Convert a Filter to a predicate function. |
Pretty Representation#
Configuration for pretty representation of objects. |
|
Configuration for pretty representation of attributes. |
|
Interface for pretty representation of objects. |
|
Pretty representation of a mapping. |
|
Mapping mixin for pretty representation. |
Struct Operation#
Create a dataclass that works with JAX transformations. |
|
Create a dataclass field with JAX pytree metadata. |
|
Base class for creating JAX-compatible pytree nodes. |
|
An immutable dictionary that works as a JAX pytree. |
Other Operations#
Clear on-device memory buffers and optionally compilation cache. |
|
Create a partial function to check if input is NOT an instance of given classes. |
|
Create a partial function to check if input IS an instance of given classes. |
|
Enhanced dictionary for managing collections in BrainState. |
|
Dictionary with dot notation access to nested keys. |