Skip to content

Avoid dimshuffle if expand_dims has empty axis #724

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 2 commits into from
Apr 21, 2024

Conversation

HangenYuu
Copy link
Contributor

@HangenYuu HangenYuu commented Apr 21, 2024

Description

A small eager optimization to avoid useless dimshuffles in expand_dims, follwing squeeze logic.

Related Issue

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

@HangenYuu
Copy link
Contributor Author

@ricardoV94 Updated here from #718.

@HangenYuu HangenYuu changed the title Eager optimization for basic.py per #707 Eager optimization for basic.py Apr 21, 2024
Copy link

codecov bot commented Apr 21, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 80.76%. Comparing base (86bc1d2) to head (65fefce).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #724      +/-   ##
==========================================
- Coverage   80.76%   80.76%   -0.01%     
==========================================
  Files         162      162              
  Lines       46713    46715       +2     
  Branches    11426    11427       +1     
==========================================
  Hits        37729    37729              
- Misses       6732     6736       +4     
+ Partials     2252     2250       -2     
Files Coverage Δ
pytensor/tensor/basic.py 88.25% <0.00%> (-0.11%) ⬇️

... and 3 files with indirect coverage changes

Copy link
Member

@ricardoV94 ricardoV94 left a comment

Choose a reason for hiding this comment

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

Looks good, just a small tweak

@ricardoV94
Copy link
Member

ricardoV94 commented Apr 21, 2024

Small request, can you edit the title to be more like the original issue?

This is what shows up on the automatic release notes and the current title is completely uninformative for someone only reading it

Co-authored-by: Ricardo Vieira <[email protected]>
@HangenYuu HangenYuu changed the title Eager optimization for basic.py Optimization for basic.py: Avoid dimshuffle if expand_dims has empty axis Apr 21, 2024
@HangenYuu
Copy link
Contributor Author

@ricardoV94

@ricardoV94 ricardoV94 changed the title Optimization for basic.py: Avoid dimshuffle if expand_dims has empty axis Avoid dimshuffle if expand_dims has empty axis Apr 21, 2024
@ricardoV94
Copy link
Member

Thanks! I hope the git stuff was not too frustrating

@ricardoV94 ricardoV94 merged commit 58aad80 into pymc-devs:main Apr 21, 2024
54 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid dimshuffle if expand_dims has empty axis
2 participants