Autograd node for with given packed as LU, wired on the aligned (batch, n, n) factor and (batch, n, k) right-hand side. The pivots are an integer input with no gradient and are held in pivots_.
With and :
the upper part being and the strict lower part (the unit diagonal of is not stored). Every step is a recorded triangular solve or product, so the result differentiates again.
Methods
5LU and B as every node guards its saved inputs, and the pivots. B stays guarded although the eager formula reads the saved solution instead: graph-mode backward recomputes X from it.