stringjax_tools.pytrees.unflatten_func_class

stringjax_tools.pytrees.unflatten_func_class#

unflatten_func_class(aux_data, children, myclass, *, ignore_defaults=None)#

Reconstruct myclass from pytree auxiliary data and children.

__init__ is intentionally bypassed. This mirrors the standard pattern for JAX pytree registration of stateful objects whose constructors may perform validation, IO, or other eager side effects.

Parameters:
  • aux_data (tuple[tuple[str, ...], tuple[tuple[str, Any], ...]]) – Auxiliary data returned by flatten_func().

  • children (tuple[Any, ...]) – Dynamic children returned by flatten_func().

  • myclass (type) – Class to reconstruct.

  • ignore_defaults (Mapping[str, Any] | None) – Optional defaults for ignored attributes. Callable defaults such as dict are called each time, so reconstructed objects do not share mutable containers.

Return type:

Any