File: leanpass/tensor.py
The first grad_check implementation calls self.zero_grad_all() correctly, but the duplicated version mistakenly calls node.zero_grad_all(), which does not exist. Moreover, the finite‑difference loop recomputes the whole forward pass for each element, which is extremely slow. The method should be consolidated, fixed, and optionally vectorized.
Filed automatically by ai-issue-scan.
File:
leanpass/tensor.pyThe first
grad_checkimplementation callsself.zero_grad_all()correctly, but the duplicated version mistakenly callsnode.zero_grad_all(), which does not exist. Moreover, the finite‑difference loop recomputes the whole forward pass for each element, which is extremely slow. The method should be consolidated, fixed, and optionally vectorized.Filed automatically by ai-issue-scan.