# Check Torch Gradients These scripts compare solver-backed real and complex PyTorch gradients with centered finite differences. See {class}`RealDerivative ` and {class}`ComplexDerivative ` for their binding types. ```{admonition} Experimental feature :class: warning The `jcmsuite.torch` integration is experimental. Its API and behavior can change in future releases. Do not depend on its current interface for production workflows without testing each package update. ``` Run them from `demos/documentation_tutorials`: ```bash python derivatives/torch/gradcheck/check_real.py python derivatives/torch/gradcheck/check_complex.py ``` ```{literalinclude} ../../../../demos/documentation_tutorials/derivatives/torch/gradcheck/check_real.py :language: python ``` ```{literalinclude} ../../../../demos/documentation_tutorials/derivatives/torch/gradcheck/check_complex.py :language: python ``` ## Project Files
layout.jcmt ```{literalinclude} ../../../../demos/documentation_tutorials/derivatives/torch/gradcheck/layout.jcmt :language: jcm ```
materials.jcmt ```{literalinclude} ../../../../demos/documentation_tutorials/derivatives/torch/gradcheck/materials.jcmt :language: jcm ```
project.jcmp ```{literalinclude} ../../../../demos/documentation_tutorials/derivatives/torch/gradcheck/project.jcmp :language: jcm ```
sources.jcm ```{literalinclude} ../../../../demos/documentation_tutorials/derivatives/torch/gradcheck/sources.jcm :language: jcm ```