debugBackwardHook top-level property
Debug hook fired after each backward closure. If non-null, called
with (stepIndex, tensor) after tensor._backward() runs. Use to
bisect which closure corrupted state.
Implementation
void Function(int, Tensor)? debugBackwardHook;