pymc-devs / pymc-devs/pytensor

Static shapes

Open
#203 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement shape inference
Dominant language
Python
Stars
644
Forks
208
Avg merge
2d 14h
Merged PRs (30d)
16

Description

Description

From this discussion on pymc discourse, "static shapes are quite recent and we are still updating Ops to reflect them when possible." -@ricardoV94

Is help still needed with ensuring static shape output from Ops where possible? If so - here's a quick (obviously incomplete!) start on listing out ops to work on.

No static shape output (todo):

  • Eye
  • conv ops (#150)

No static shape output (and perhaps to remain as such):

  • Subtensor (indexation)

Could fail earlier:

  • Dot: outputs correct static shape if the input shapes align, but outputs incorrect static shape if input shapes are wrong. Error at eval time
  • SpecifyShape: similar to Dot. ptt.specify_shape(np.ones((2,3)), shape=(3,3)).type # tensortype shape (2,3)

Recently addressed:

  • Join #164
  • MaxAndArgmax #206

Hopefully this is the right place to start the discussion. If help is wanted, I would appreciate some guidance on how to go about this in a more principled way -- where/how to look, what a fix might look like, etc -- and of course any other suggestion on Ops that don't yet support static shape output.

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 with the linked PyMC Discourse discussion and the listed Ops: Eye, conv ops, Subtensor, Dot, and SpecifyShape; compare them with the recently addressed Join and MaxAndArgmax issues (#150, #164, and #206). The issue needs a decision on which gaps are actionable and what correct static-shape behavior means before implementation can be considered done.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.