Skip to content

Conversation

@ricardoV94
Copy link
Member

Size is ignored when the output_bc_pattern implies it must be length 1, but shouldn't be ignored otherwise

Evaluating pt.random.dirichlet(..., size=(2,)) after having evaluated with size=(1,) would return only 1 draw due to reusing the cached first function, which ignored the redundant runtime size.

Issue found in pymc-devs/pymc#7993

core_shape_len,
inplace,
input_bc_patterns,
output_bc_patterns,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix is adding this to the key, the other changes are just simplification

@ricardoV94 ricardoV94 added bug Something isn't working numba random variables labels Dec 27, 2025
Size is ignored when the output_bc_pattern implies it must be length 1, but shouldn't be ignored otherwise
@ricardoV94 ricardoV94 merged commit be866f9 into pymc-devs:main Dec 28, 2025
66 checks passed
@ricardoV94 ricardoV94 deleted the fix_numba_rv_cache_key branch December 28, 2025 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working numba random variables

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants