File: leanpass/tensor.py
During gradient checking the code invokes self.zero_grad_all(), but Tensor only defines zero_grad. This results in an AttributeError and makes grad_check unusable. Replace the call with the existing method or implement zero_grad_all that zeros gradients of all leaf tensors.
# replace
- self.zero_grad_all()
+ self.zero_grad()
Filed automatically by ai-issue-scan.
File:
leanpass/tensor.pyDuring gradient checking the code invokes
self.zero_grad_all(), butTensoronly defineszero_grad. This results in anAttributeErrorand makesgrad_checkunusable. Replace the call with the existing method or implementzero_grad_allthat zeros gradients of all leaf tensors.Filed automatically by ai-issue-scan.