Skip to content

grad_check relies on undefined method and incomplete forward evaluation #35

Description

@github-actions

File: leanpass/tensor.py

The Tensor.grad_check implementation calls self.zero_grad_all(), but no such method exists in the library (only Module.zero_grad). It also uses self._eval_forward() which is defined later but never returns a value, making the finite‑difference check unusable and raising an AttributeError. This breaks the only built‑in gradient‑checking utility.

Fix: implement a zero_grad method on Tensor (or call the existing one on leaf tensors) and complete _eval_forward to return the forward‑evaluated output values.

Label: bug

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