Python wrappers
Public Python APIs implemented by this engine symbol.Autograd node for the matrix inverse .
The forward result is captured in saved_output_;
no input is saved because the closed-form gradient only requires
. This trades a single matrix-shaped retain (peak memory) for
avoiding a second LU factorisation during backward.
Math
Shape
A:(..., N, N).B = A^{-1}: same shape asA.grad_out: same shape asA.
References
Giles, "Collected Matrix Derivative Results for Forward and Reverse Mode Algorithmic Differentiation" (Oxford NA-08/01, 2008), §2.2.3. Petersen & Pedersen, The Matrix Cookbook (2012), §9.1.3.
Attributes
schema_v1OpSchema"inv", one input, AmpPolicy::KeepInput so mixed-precision training does not silently downcast the saved inverse.saved_output_StorageStorage of the forward result retained for the backward.
Notes
- For very large matrices in deep graphs, holding alive until backward increases peak memory; users wishing to trade memory for compute would need to recompute the inverse (not currently supported here).
- Implementation uses
matmul_op+neg_opso second-order gradients flow through automatically.