Skip to content

grad_check uses undefined method and inefficient loops #17

Description

@github-actions

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions