计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
module-and-trees【效率与协作】Use Equinox modules, fields, PyTree filtering, and tree surgery correctly.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill for Equinox’s core model-as-PyTree abstraction and the utilities that manipulate mixed PyTrees.
eqx.Module subclass.eqx.field, converters, static fields, AbstractVar,
AbstractClassVar, or __check_init__.tree_at, trainable/static partitioning,
tree_equal, tree_check, apply_updates, or Partial.../filtered-transformations/ when the main issue is filter_jit,
filter_grad, filter_vmap, filter_pmap, AD, callbacks, or sharding.../nn-and-state/ for built-in equinox.nn layers, stateful modules,
Shared, and inference-mode behavior.../diagnostics-and-serialization/ for saving/loading leaves, runtime
errors, pretty printing, progress meters, or debug tools.../internal-advanced/ only for semi-public equinox.internal helpers.references/module-and-trees.md for module patterns, API decisions, and
model-surgery recipes.references/troubleshooting.md for common eqx.Module, static-field,
converter, and mixed-leaf failures.../../references/api-reference.md for a cross-skill symbol index.eqx.Module subclass with annotated fields. Use a custom
__init__ only when construction logic needs it; otherwise rely on dataclass
initialization.eqx.field(static=True) when it should not be a PyTree leaf.eqx.field(converter=...) for safe field normalization at initialization
time.__check_init__ for invariant checks; do not mutate fields inside it.eqx.partition or eqx.filter,
using predicates such as eqx.is_inexact_array, before optimizers or raw
JAX transforms.eqx.tree_at for out-of-place surgery such as replacing a final layer,
changing an initializer result, or toggling nested leaves.eqx.tree_check and compare expected outputs with
eqx.tree_equal.From the generated skill root (set EQUINOX_SKILL_ROOT to its absolute path),
run the bundled smoke helper after installing Equinox:
cd "$EQUINOX_SKILL_ROOT" && python scripts/smoke.py --mode module
This checks module construction, static-field preservation, partition/combine,
tree_at, and tree_check using only the installed package and bundled runtime
files.
This sub-skill distills Equinox's public module, filter, tree-manipulation, and
training-update behavior into the bundled references. Future agents should use
references/module-and-trees.md, references/troubleshooting.md, and
scripts/smoke.py; the source repository was construction evidence only, not a
runtime dependency.
jax.jit and jax.grad are valid only when their dynamic arguments are
all JAX-compatible leaves. Use filtered transforms for mixed modules.