pymc-devs / pymc-devs/pytensor

`Blockwise{Convolve1d}` never infers static output shape

Open
#1,998 2 comments 0 reactions 0 assignees View on GitHub

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 main at c31183051)
  • Python version: 3.12
  • Operating system: macOS (ARM64)
  • How did you install PyTensor: pixi (conda-forge)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.