Skip to content

Add on_error argument to linalg functions #1078

Open
@jessegrabowski

Description

@jessegrabowski

Description

Our implementation of Cholesky has a nice argument on_error that lets the user get back nan from an bad input instead of halting the program. This would be a nice feature to have in other places where shoving in random matrices (pun intended) can be dangerous. I'm thinking specifically about pt.linalg.solve, but I kept the issue name generic in case we think of others.

The fix itself is trivial: add a try/except around the perform method of e.g. solve. The only wrinkle I foresee is what to do with the gradients.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions