pymc-devs / pymc-devs/pytensor
`params_broadcast_shapes` logic is wrong
Open
Nobody has claimed this yet.
bug
random variables
- Dominant language
- Python
- Stars
- 644
- Forks
- 208
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 16
Description
This helper uses max to broadcast dimensions, but this is wrong because a dim of length 1 should broadcasted to length 0 if that's the length of the other dim
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pytensor/tensor/random/utils.py at the linked params_broadcast_shapes helper and inspect how it combines dimensions with max. Reproduce the case where one dimension is 1 and the other is 0, then verify that the resulting broadcast shape follows the issue’s expected behavior and that existing broadcasting cases remain correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100