Skip to content

Vectorize dispatch for shape operations #454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

ricardoV94
Copy link
Member

It also fixes a bug when Blockwising a Reshape Op, as the perform method had a non-optional (useless) params kwarg

@ricardoV94 ricardoV94 added bug Something isn't working enhancement New feature or request labels Sep 24, 2023
@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2023

Codecov Report

Merging #454 (bd72bc7) into main (36df379) will increase coverage by 0.01%.
Report is 4 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #454      +/-   ##
==========================================
+ Coverage   80.66%   80.67%   +0.01%     
==========================================
  Files         160      160              
  Lines       46025    46060      +35     
  Branches    11266    11277      +11     
==========================================
+ Hits        37124    37159      +35     
  Misses       6668     6668              
  Partials     2233     2233              
Files Coverage Δ
pytensor/graph/replace.py 86.45% <100.00%> (+0.28%) ⬆️
pytensor/tensor/blockwise.py 79.05% <100.00%> (-0.22%) ⬇️
pytensor/tensor/elemwise.py 88.59% <100.00%> (-0.02%) ⬇️
pytensor/tensor/random/op.py 96.25% <ø> (ø)
pytensor/tensor/shape.py 92.91% <100.00%> (+0.52%) ⬆️
pytensor/tensor/type.py 94.52% <100.00%> (+0.04%) ⬆️

@ricardoV94 ricardoV94 changed the title Vectorize shape operations Vectorize dispatch for shape operations Sep 24, 2023
@ricardoV94 ricardoV94 mentioned this pull request Nov 9, 2023
8 tasks
@ricardoV94 ricardoV94 force-pushed the vectorize_shape_ops branch 3 times, most recently from acbc810 to 519af52 Compare November 17, 2023 12:13
Copy link
Member

@jessegrabowski jessegrabowski left a comment

Choose a reason for hiding this comment

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

Just hit this bug, so I'm suddenly motivated to review : )

Looks great. Small nitpicks if you want them: There's some code duplication for error handling between the dispatchers for specify shape and reshape that could be refactored. Same with the test cases -- could probably just use a mark.parameterize decorator to pass in which Op to test, and make the actual test cases shared?

None of this blocks tho

@ricardoV94
Copy link
Member Author

The two are ever so slightly different because reshape takes a vector and SpecifyShape takes individual dim lengths. I think it's better to jut be a bit repetitive here for the sake of more clear code.

@ricardoV94 ricardoV94 merged commit 7eafb6c into pymc-devs:main Nov 17, 2023
@ricardoV94 ricardoV94 deleted the vectorize_shape_ops branch November 17, 2023 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants