File: leanpass/tensor.py
Tensor.log directly calls np.log(self.data) without checking for non‑positive inputs. Passing zero or negative values yields -inf or nan, propagating invalid gradients. Adding a small epsilon (e.g., np.log(np.clip(self.data, eps, None))) or raising a clear error would make the operation safer and align with typical autodiff expectations.
Filed automatically by ai-issue-scan.
File:
leanpass/tensor.pyTensor.logdirectly callsnp.log(self.data)without checking for non‑positive inputs. Passing zero or negative values yields-infornan, propagating invalid gradients. Adding a small epsilon (e.g.,np.log(np.clip(self.data, eps, None))) or raising a clear error would make the operation safer and align with typical autodiff expectations.Filed automatically by ai-issue-scan.