Skip to content

Replace assert checks in logprob.scan with real error handling #7780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jessegrabowski opened this issue May 9, 2025 · 1 comment
Open
Labels
enhancements hackathon Suitable for hackathon help wanted needs info Additional information required pytensor

Comments

@jessegrabowski
Copy link
Member

Description

There are two annoying assert checks that I commonly run up against when writing time series models here and here. Other users are hitting them too, see for example here.

It would be much nicer to have a real error message that explains what has gone wrong and why, or at least gives some information about which parts of the graph are going wrong.

I'm not 100% sure how one ends up hitting these asserts, so I tagged this with needs info. It seems to have to do with having multiple outputs from the scan inner function in a custom dist.

@ricardoV94
Copy link
Member

In general we should address #6691 to tell users why logprob inference failed. The assert failing is a bug though, when we can't derive the logprob we should not even reach that line, and fallback to the default uninformative RuntimeError: Logprob could not be derived

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancements hackathon Suitable for hackathon help wanted needs info Additional information required pytensor
Projects
None yet
Development

No branches or pull requests

3 participants