pymc-devs / pymc-devs/pytensor
`Blockwise{Convolve1d}` never infers static output shape
Open
Nobody has claimed this yet.
shape inference
- Dominant language
- Python
- Stars
- 644
- Forks
- 208
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 16
Description
Describe the issue:
pt.signal.convolve1d always produces (None,) output shape, even when both input shapes and the mode are fully known at graph construction time.
Reproducable code example:
import pytensor.tensor as pt
x = pt.vector('x', shape=(61,))
k = pt.vector('k', shape=(10,))
conv = pt.signal.convolve1d(x, k, mode='full')
print(conv.type.shape) # (None,) — expected (70,)
bx = pt.matrix('bx', shape=(4, 61))
bk = pt.matrix('bk', shape=(4, 10))
bconv = pt.signal.convolve1d(bx, bk, mode='full')
print(bconv.type.shape) # (4, None) — expected (4, 70)
Error message:
PyTensor version information:
- PyTensor version: 2.38.2 (also confirmed on
mainatc31183051) - Python version: 3.12
- Operating system: macOS (ARM64)
- How did you install PyTensor: pixi (conda-forge)
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 at the pt.signal.convolve1d entry point and the Blockwise/Convolve1d shape-inference logic described in the issue. Reproduce the one- and two-dimensional examples, then verify that fully known inputs and mode produce static output shapes such as (70,) and (4, 70).
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100