-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix bug in mixture logprob inference with None
indices
#7877
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
Fix bug in mixture logprob inference with None
indices
#7877
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7877 +/- ##
=======================================
Coverage 92.94% 92.94%
=======================================
Files 116 116
Lines 18845 18845
=======================================
Hits 17516 17516
Misses 1329 1329
🚀 New features to boost your workflow:
|
Hi @ricardoV94 , Thank you for your comments. I've addressed them now
EDIT: I had to troubleshoot a bit, but now the PR looks to be in good state. Sorry for the alarm. :) |
723ba71
to
65fb015
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good just a small cleanup suggestion on the test
65fb015
to
2102cb9
Compare
AdvancedSubTensor
with None
and integer raises a logp
error instead of silently failing
Thanks @asifzubair |
None
indices
Description
Previously, calculating the log-probability (
logp
) of anAdvancedSubTensor
that included aNone
index would cause the system to crash with an unhandled internalAttributeError
.This change resolves the bug by adding a guard within the
logp
rewriting logic inmixture.py
. Instead of crashing, the system now correctly identifies the ambiguous operation and raises a controlledRuntimeError
.A new test,
test_advanced_subtensor_none_and_integer
, has been added totest_mixture.py
to validate this fix and prevent regressions.Reproducible example from the ticket now executes:
Related Issue
AdvancedSubTensor
withNone
and integer indices raises alogprob
error instead of silently failing #7762Checklist
Type of change
📚 Documentation preview 📚: https://pymc--7877.org.readthedocs.build/en/7877/