-
Notifications
You must be signed in to change notification settings - Fork 25.2k
[torch.special] Add special.erf{c, inv} #53260
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
[torch.special] Add special.erf{c, inv} #53260
Conversation
💊 CI failures summary and remediationsAs of commit 6031492 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions to the (internal) Dr. CI Users group. |
Codecov Report
@@ Coverage Diff @@
## master #53260 +/- ##
==========================================
- Coverage 77.48% 77.47% -0.01%
==========================================
Files 1889 1889
Lines 184870 184880 +10
==========================================
+ Hits 143240 143244 +4
- Misses 41630 41636 +6 |
torch/special/__init__.py
Outdated
r""" | ||
erf(input, *, out=None) -> Tensor | ||
|
||
Computes the error function of each element. The error function is defined as follows: |
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.
"of each element of :attr:`input`" would be more precise.
Alternatively this could say "Computes the error function of :attr:`input`." to be more direct.
""") | ||
""".format(**common_args)) | ||
|
||
erf = _add_docstr(_special.special_erf, |
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.
This need to be added to special.rst, too
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.
Hey @kshitij12345! Overall looks good. Would you update the .rst? I want to double-check the doc artifacts but they won't render until it's updated.
Link to documentation artifacts : https://11368241-65600975-gh.circle-artifacts.com/0/docs/special.html |
@mruberry Gentle Ping :) . Will rebase it with any changes if necessary. |
erfinv(input, *, out=None) -> Tensor | ||
|
||
Computes the inverse error function of :attr:`input`. | ||
The inverse error function is defined in the range :math:`(-1, 1)` as: |
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.
In a docs cleanup PR this may want to elaborate on how the inverse function is computed, and why its range is restricted (and what happens when inputs beyond that range are given).
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.
Docs looks really good (and much better than the corresponding SciPy docs).
PR looks good, just needs a rebase and for tests to pass. A future PR may want to extend the inverse error function documentation. |
Gentle Ping :) |
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.
@mruberry has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Unfortunately this picked up a merge conflict, @kshitij12345. Would you please rebase it? |
Done :) |
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.
@mruberry has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
@mruberry has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Reference: #50345
Also adds
overrides
entry for module and the newly added functions.