-
Notifications
You must be signed in to change notification settings - Fork 134
Correct bad imports in optimize.py and expose it via pytensor.tensor.__init__
#1464
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
Correct bad imports in optimize.py and expose it via pytensor.tensor.__init__
#1464
Conversation
Also add it to the docs? |
Yes you are right of course. |
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (64.86%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #1464 +/- ##
==========================================
- Coverage 82.14% 82.01% -0.13%
==========================================
Files 213 214 +1
Lines 50270 50416 +146
Branches 8879 8901 +22
==========================================
+ Hits 41295 41350 +55
- Misses 6774 6858 +84
- Partials 2201 2208 +7
🚀 New features to boost your workflow:
|
Let's benchmark the import time of PyTensor to see if importing scipy optimize doesn't cause a big slowdown |
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@@ -0,0 +1,1615 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that merged? Or you want me to try the nb in that feature branch
I don't understand what this means |
Install https://pypi.org/project/benchmark-imports and check the output of that line before and after you made optimize.py imported in |
This was the case with the eager import of scipy.stats: #1268 |
Here is the output:
I'm happy to move the imports into perform though, even if the cost is small |
Can you show the output with the lazy optimize (just revert adding it to |
Cost seems to be around 1.2x slower. Also keeping in mind the majority of users will not use these Ops or may use only in other backends |
True enough. I moved imports into the perform methods. Here's the updated benchmark:
|
We should also remove the props. you can override the str/repr methods to show them, but we shouldn't use props because they are not enough to ascertain equality of ops (the inner graph would also have to be considered in the hash and equality). This is something we still need to work on |
Description
Small PR to improve the visibility of
pytensor.tensor.optimize
and to fix some bad imports in the file.Related Issue
Checklist
Type of change
📚 Documentation preview 📚: https://pytensor--1464.org.readthedocs.build/en/1464/