File: leanpass/tensor.py
The backward implementation computes -out.grad * self.data / (other.data ** 2). If other.data contains zeros, this yields infinities or crashes. NumPy will raise a runtime warning and propagate inf values.
Fix: add a small epsilon to the denominator or raise a clear error when dividing by a tensor that may contain zeros.
Label: bug
Filed automatically by ai-issue-scan.
File:
leanpass/tensor.pyThe backward implementation computes
-out.grad * self.data / (other.data ** 2). Ifother.datacontains zeros, this yields infinities or crashes. NumPy will raise a runtime warning and propagateinfvalues.Fix: add a small epsilon to the denominator or raise a clear error when dividing by a tensor that may contain zeros.
Label: bug
Filed automatically by ai-issue-scan.