Skip to content

log operation lacks input validation #48

Description

@github-actions

File: leanpass/tensor.py

The Tensor.log method computes np.log(self.data) without checking that self.data is strictly positive. Passing zeros or negative values yields -inf or nan and propagates silently, which is numerically unstable and deviates from typical autodiff libraries that raise a domain error. Add a guard that raises a ValueError for non‑positive inputs.

Filed automatically by ai-issue-scan.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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