Autograd Gradient
Backpropagate through a sum of squares and check the gradient against 2x. This page includes a preview and an autorun-ready lmscript source file.

Let an agent build from this example
Copy this prompt into your Lead's terminal to ask an agent to complete a related task:
Use lmtorch to compute and verify a small tensor result. Run the example
with the released host, report the source and output, and confirm its
expected value. Use the lmtorch API and the Autograd Gradient example
below. Report the source, output, and verification.
LMScript DSL: https://lmctl.com/tools/lmscript/skill.html
lmtorch API: https://lmctl.com/tools/lmtorch/guide.html
Autograd Gradient example:
https://lmctl.com/tools/lmtorch/examples/autograd-gradient.html
Run the example
lmctl autorun \
https://lmctl.com/tools/lmtorch/examples/autograd-gradient.lms
Read the autorun source. Also see Tensor sum example. See get started with provider runs.
Source from the project
The original example is autograd-gradient-dsl.lms at 63620aecc8. The published autorun source includes the host declaration and any setup needed to run it from a new directory.