Autograd
Use this repo skill when a user asks about Autograd gradients, Jacobians, Hessians, custom primitives, autograd.numpy, autograd.scipy, structured optimizers, or fixed-point helpers. The package is library-only; there is no CLI route.
Read first
references/installation.md for public install commands and optional extras.
references/repo-provenance.md when checking whether this skill matches the current repository state or before refreshing it.
references/troubleshooting.md for cross-cutting install, import, optional-dependency, and usage failures.
scripts/autograd_smoke.py for a quick install-and-import sanity check.
Route map
- Core differentiation: sub-skills/differentiation-core/SKILL.md
- Use for
grad, jacobian, elementwise_grad, value_and_grad, higher-order derivatives, make_vjp, make_jvp, holomorphic_grad, and gradient checking.
- NumPy and SciPy wrappers: sub-skills/numpy-scipy-primitives/SKILL.md
- Use for
autograd.numpy, autograd.scipy, supported/unsupported NumPy patterns, xarray interoperability, and missing SciPy-extra troubleshooting.
- Custom primitives: sub-skills/extend-primitives/SKILL.md
- Use for
primitive, defvjp, defjvp, deprecated wrapper compatibility, and gradient checking around a new rule.
- Optimization workflows: sub-skills/optimization-workflows/SKILL.md
- Use for
flatten, structured optimizers, fixed_point, and scipy.optimize.minimize with value_and_grad.
Install
For a regular user install:
pip install autograd
For the full NumPy/SciPy wrapper surface used by this skill:
pip install "autograd[scipy]"
If you are working from a checkout and want an editable install:
pip install -e '.[scipy]'
Optional xarray container-interoperability examples need xarray installed separately.
Minimal smoke
Run the bundled smoke helper after installation:
python scripts/autograd_smoke.py
Use --require-scipy when you want the smoke to fail instead of skipping the optional SciPy section.
How to choose a route
- If the problem is “what derivative operator should I use?”, start with differentiation-core.
- If the problem is “why does a NumPy/SciPy expression fail or behave oddly under Autograd?”, start with numpy-scipy-primitives.
- If the problem is “how do I make my own function differentiable?”, start with extend-primitives.
- If the problem is “how do I optimize a structured parameter tree or use SciPy minimize?”, start with optimization-workflows.
Notes for future refreshes
Read references/repo-provenance.md before refreshing this skill against a new Autograd checkout. The provenance snapshot records the source commit, dirty state, package version, and evidence paths used to build the current skill.
1---2name: autograd3description: "Routes Autograd install, differentiation, wrapper, extension, and4 optimization workflows for NumPy-based scientific Python code."5disable-model-invocation: true6metadata:7 source: https://skillmd.com/skills/vectorspacelab/autograd8 disco-role: operating9license: MIT10---1112# Autograd1314Use this repo skill when a user asks about Autograd gradients, Jacobians, Hessians, custom primitives, `autograd.numpy`, `autograd.scipy`, structured optimizers, or fixed-point helpers. The package is library-only; there is no CLI route.1516## Read first1718- `references/installation.md` for public install commands and optional extras.19- `references/repo-provenance.md` when checking whether this skill matches the current repository state or before refreshing it.20- `references/troubleshooting.md` for cross-cutting install, import, optional-dependency, and usage failures.21- `scripts/autograd_smoke.py` for a quick install-and-import sanity check.2223## Route map2425- **Core differentiation**: [sub-skills/differentiation-core/SKILL.md](sub-skills/differentiation-core/SKILL.md)26 - Use for `grad`, `jacobian`, `elementwise_grad`, `value_and_grad`, higher-order derivatives, `make_vjp`, `make_jvp`, `holomorphic_grad`, and gradient checking.27- **NumPy and SciPy wrappers**: [sub-skills/numpy-scipy-primitives/SKILL.md](sub-skills/numpy-scipy-primitives/SKILL.md)28 - Use for `autograd.numpy`, `autograd.scipy`, supported/unsupported NumPy patterns, xarray interoperability, and missing SciPy-extra troubleshooting.29- **Custom primitives**: [sub-skills/extend-primitives/SKILL.md](sub-skills/extend-primitives/SKILL.md)30 - Use for `primitive`, `defvjp`, `defjvp`, deprecated wrapper compatibility, and gradient checking around a new rule.31- **Optimization workflows**: [sub-skills/optimization-workflows/SKILL.md](sub-skills/optimization-workflows/SKILL.md)32 - Use for `flatten`, structured optimizers, `fixed_point`, and `scipy.optimize.minimize` with `value_and_grad`.3334## Install3536For a regular user install:3738```bash39pip install autograd40```4142For the full NumPy/SciPy wrapper surface used by this skill:4344```bash45pip install "autograd[scipy]"46```4748If you are working from a checkout and want an editable install:4950```bash51pip install -e '.[scipy]'52```5354Optional xarray container-interoperability examples need `xarray` installed separately.5556## Minimal smoke5758Run the bundled smoke helper after installation:5960```bash61python scripts/autograd_smoke.py62```6364Use `--require-scipy` when you want the smoke to fail instead of skipping the optional SciPy section.6566## How to choose a route6768- If the problem is “what derivative operator should I use?”, start with **differentiation-core**.69- If the problem is “why does a NumPy/SciPy expression fail or behave oddly under Autograd?”, start with **numpy-scipy-primitives**.70- If the problem is “how do I make my own function differentiable?”, start with **extend-primitives**.71- If the problem is “how do I optimize a structured parameter tree or use SciPy minimize?”, start with **optimization-workflows**.7273## Notes for future refreshes7475Read `references/repo-provenance.md` before refreshing this skill against a new Autograd checkout. The provenance snapshot records the source commit, dirty state, package version, and evidence paths used to build the current skill.