-
Notifications
You must be signed in to change notification settings - Fork 135
Add inf special cases in C implementation of gamma related functions #634
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
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #634 +/- ##
=======================================
Coverage 80.82% 80.83%
=======================================
Files 162 162
Lines 46744 46758 +14
Branches 11418 11420 +2
=======================================
+ Hits 37783 37795 +12
- Misses 6716 6717 +1
- Partials 2245 2246 +1
|
You'll need to define methods like these for the old caches to be ignored, for all Ops that use these two functions. pytensor/pytensor/scalar/math.py Lines 1391 to 1396 in 34bfe31
That and some tests and we're good to go! |
Thanks for this information! I have added them to any function that uses pytensor/pytensor/compile/ops.py Line 74 in ee7c946
I also added tests to test_math.py, I guess this is sufficient but let me know if I forget to add any other test place. |
@amyoshino yes your reasoning is correct |
This is great @amyoshino |
Cool! One more step to close pymc-devs/pymc#6845 😄 |
Any day now xD We plan to release sometime this week |
Description
gammainc C code does not have a special case for np.inf.
Instead of returning 0, 1 or nan it always return nan.
The solution is to add special cases conditions following scipy implementation: https://github.com/scipy/scipy/blob/4ecf5638c36c3a87b473056f5fffecfeddffd368/scipy/special/cephes/igam.c#L149-L151
Related Issue
Checklist
Type of change