File: leanpass/tensor.py
Calling log() on a tensor containing zero or negative numbers produces -inf or nan without warning, and the backward pass will propagate these invalid values. Standard autograd libraries either raise an error or clamp the input to a small epsilon for numerical stability.
Fix: add a check that all elements are > 0 (or >= epsilon) and raise a ValueError or clamp the data before applying np.log.
Label: bug (numerical stability).
Filed automatically by ai-issue-scan.
File:
leanpass/tensor.pyCalling
log()on a tensor containing zero or negative numbers produces-infornanwithout warning, and the backward pass will propagate these invalid values. Standard autograd libraries either raise an error or clamp the input to a small epsilon for numerical stability.Fix: add a check that all elements are > 0 (or >= epsilon) and raise a
ValueErroror clamp the data before applyingnp.log.Label: bug (numerical stability).
Filed automatically by ai-issue-scan.