drinx.static_field#
- drinx.static_field(*, default=<dataclasses._MISSING_TYPE object>, default_factory=<dataclasses._MISSING_TYPE object>, init=True, repr=True, hash=None, compare=True, metadata=None, kw_only=<dataclasses._MISSING_TYPE object>, on_setattr=(), on_getattr=())[source]#
Define a JAX-static dataclass field.
Convenience wrapper around
field()withstatic=Truepre-set. The field is excluded from JAX tracing and stored as pytree auxiliary data, meaning changes to it trigger recompilation underjit. Use this for configuration values, shapes, or other compile-time constants.- Parameters:
default (
Any) – Default value for the field.default_factory (
Union[Callable[[],Any],Any]) – Zero-argument callable returning the default value.init (
bool) – Include the field in the generated__init__.repr (
bool) – Include the field in the generated__repr__.hash (
bool|None) – Include the field in__hash__(Nonedefers to compare).compare (
bool) – Include the field in__eq__and ordering methods.metadata (
dict[str,Any] |None) – Additional metadata merged with thejax_staticentry.kw_only (
Any) – Override the class-levelkw_onlysetting for this field.
- Return type:
Any- Returns:
A
dataclasses.Fielddescriptor (typed asAny).