filterlib#
- flax.nnx.filterlib.to_predicate(filter)[source]#
Converts a Filter to a predicate function. See Using Filters.
- class flax.nnx.WithTag(tag)[source]#
Filter that matches values with a string
tagattribute equal to the given tag.Used by
RngKeyandRngCount. See Using Filters.- tag#
The string tag to match against a value’s
tagattribute.- Type:
str
- class flax.nnx.PathContains(key, exact=True)[source]#
Filter that matches values whose associated path contains the given key.
See Using Filters.
- key#
The key to look for in the value’s path.
- Type:
flax.typing.Key | str
- exact#
If
True,keymust equal a path element exactly. IfFalse, matches whenkeyis contained in the string form of any path element.- Type:
bool
- class flax.nnx.OfType(type)[source]#
Filter that matches values that are instances of
type, or that have atypeattribute that is an instance oftype.See Using Filters.
- type#
The type to match values against.
- Type:
type
- class flax.nnx.Any(*filters)[source]#
Filter that matches values matching any of the inner filters.
See Using Filters.
- class flax.nnx.All(*filters)[source]#
Filter that matches values matching all of the inner filters.
See Using Filters.
- class flax.nnx.Not(collection_filter, /)[source]#
Filter that matches values that do not match the inner filter.
See Using Filters.
- class flax.nnx.Everything[source]#
Filter that matches all values.
See Using Filters.
- class flax.nnx.Nothing[source]#
Filter that matches no values.
See Using Filters.