struct#
Core struct abstraction.
A Struct is a PyTree dataclass with a few extra features.
In penzai, Struct is used as the primary way to define any class that should behave as a JAX pytree, not just neural network modules.
Classes
The metaclass for penzai.Struct and its (possibly abstract) subclasses. |
|
Base class for penzai PyTree structures. |
|
Container for a struct's static fields. |
Functions
Checks if a class was wrapped in the |
|
|
Returns True if this field is treated as a PyTree child node by Struct. |
|
Decorator for constructing a frozen PyTree dataclass. |
Exceptions
Error raised due to pytree dataclass safety checks. |