Skip to content

Add rewrite for log(sqrt(x)) #1555

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 11 commits into from
Jul 28, 2025
Merged

Add rewrite for log(sqrt(x)) #1555

merged 11 commits into from
Jul 28, 2025

Conversation

williambdean
Copy link
Contributor

@williambdean williambdean commented Jul 27, 2025

Description

Related Issue

Checklist

Type of change

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

📚 Documentation preview 📚: https://pytensor--1555.org.readthedocs.build/en/1555/

@williambdean williambdean linked an issue Jul 27, 2025 that may be closed by this pull request
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 great, just a small note

@ricardoV94 ricardoV94 changed the title add rewrite for log(sqrt(x)) Add rewrite for log(sqrt(x)) Jul 28, 2025
@ricardoV94
Copy link
Member

Neat!

@williambdean
Copy link
Contributor Author

@ricardoV94
Copy link
Member

There's a new test utility that does equal_computation, and also dprints the graph if it fails, that we can start using for tests. It makes it easier to debug why the test is failing

Copy link

codecov bot commented Jul 28, 2025

Codecov Report

❌ Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.53%. Comparing base (892a8f0) to head (c139f75).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pytensor/tensor/rewriting/math.py 84.61% 1 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (84.61%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1555      +/-   ##
==========================================
- Coverage   81.53%   81.53%   -0.01%     
==========================================
  Files         230      230              
  Lines       53066    53079      +13     
  Branches     9423     9425       +2     
==========================================
+ Hits        43269    43279      +10     
- Misses       7364     7365       +1     
- Partials     2433     2435       +2     
Files with missing lines Coverage Δ
pytensor/tensor/rewriting/math.py 90.39% <84.61%> (-0.05%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ricardoV94 ricardoV94 merged commit b55c473 into main Jul 28, 2025
72 of 73 checks passed
@ricardoV94
Copy link
Member

Thanks hero

@ricardoV94 ricardoV94 deleted the 1437-rewrite-logsqrtx-05-logx branch July 28, 2025 15:50
@ricardoV94
Copy link
Member

PS: a bit less noisy if you create branches on your fork than on the pytensor one, so we don't need to go about deleting stale branches in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewrite log(sqrt(x)) -> 0.5 * log(x)
2 participants