Fix for special.zeta nan handling - follow-up PR #138653 #146618
Labels
module: special
Functions with no exact solutions, analogous to those in scipy.special
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Uh oh!
There was an error while loading. Please reload this page.
🚀 The feature, motivation and pitch
Continuing PR #138653.
I hereby attach the suggestion of Albert Steppi (@steppi):
Now that we have this background out of the way. I think my preference in SciPy would be to change zeta(x, q) to be nan and to codify this as a recommendation in a special function array API extension as considered data-apis/array-api#725. I'm not sure what the downstream implications of this change might be though, and would be happy to hear feedback.
If there's no interest for PyTorch extending zeta to x < 1, then having zeta(1, q) return +inf makes sense, and by the principle guiding such special cases in the C99 standard, having zeta(1, nan) return +inf also makes sense in my opinion. However, through the work we are doing in SciPy discussed here, scipy/xsf#1, it would become straightforward for PyTorch to extend zeta if we extend it in SciPy, by using the xsf library as a shared dependency (although you would lose the ability to test against SciPy as an independent reference).
@rgommers @janeyx99 @mruberry
Alternatives
No response
Additional context
No response
cc @mruberry @kshitij12345
The text was updated successfully, but these errors were encountered: