BUG: AdvancedSubTensor
with None
and integer indices raises a logprob
error instead of silently failing
#7762
Labels
Describe the issue:
I just ran into a logprob rewrite error with an
AdvancedSubTensor
op that mixedNone
entries andint32
indices together. This wasn't actually a mixture model but logprob found the op and tried to apply its rewrite rules and raised an error instead of just failing silently. The problem seems to be from this line that doesn't include a guard against aNone
constant as well as aslice
constant.Reproduceable code example:
Error message:
but sampling works fine because the rewrite was actually supposed to fail and return
None
.PyMC version information:
Github main
Context for the issue:
This doesn't really affect anything. It just confuses regular users that see the error traceback from rewriting and get alarmed. It would be more elegant to handle this extra indexer type just like with slice constants.
The text was updated successfully, but these errors were encountered: