jaxdem.utils.serialization#

Import-path encoding and restoration of checkpoint callables.

Functions

decode_callable(path)

Import a callable from a dotted path string.

encode_callable(fn)

Return an import path after proving it resolves to this callable.

jaxdem.utils.serialization.encode_callable(fn: Callable[[...], Any]) → str[source]#

Return an import path after proving it resolves to this callable.

Checkpoints store callables by reference, so local functions, closures and aliases that do not round-trip by identity are not portable and are rejected at save time.

jaxdem.utils.serialization.decode_callable(path: str) → Callable[[...], Any][source]#

Import a callable from a dotted path string.

Importing executes module code. Callers must only decode metadata from a trusted source.