drinx.static_private_field

drinx.static_private_field#

drinx.static_private_field(*, default=<dataclasses._MISSING_TYPE object>, default_factory=<dataclasses._MISSING_TYPE object>, repr=True, hash=None, compare=True, metadata=None, kw_only=<dataclasses._MISSING_TYPE object>, on_setattr=(), on_getattr=())[source]#

Define a private (non-init), JAX-static dataclass field.

Convenience wrapper combining the behaviour of static_field() and private_field(): init=False and static=True are both pre-set. The field is excluded from __init__ and from JAX tracing, and must be assigned a value via default or default_factory.

Parameters:
  • default (Any) – Default value for the field.

  • default_factory (Union[Callable[[], Any], Any]) – Zero-argument callable returning the default value.

  • repr (bool) – Include the field in the generated __repr__.

  • hash (bool | None) – Include the field in __hash__ (None defers to compare).

  • compare (bool) – Include the field in __eq__ and ordering methods.

  • metadata (dict[str, Any] | None) – Additional metadata merged with the jax_static entry.

  • kw_only (Any) – Override the class-level kw_only setting for this field.

Return type:

Any

Returns:

A dataclasses.Field descriptor (typed as Any).