Skip to content

Commit

Permalink
Update torch.arange doc. (#99963)
Browse files Browse the repository at this point in the history
To always exclude `end` without being affected by rounding error, `epsilon` should be subtracted, instead of being added.

Fixes #99853

Pull Request resolved: #99963
Approved by: https://github.com/kit1980
  • Loading branch information
amitani authored and pytorchmergebot committed Apr 26, 2023
1 parent 08c49ee commit c11441f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch/_torch_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9357,7 +9357,7 @@ def merge_dicts(*dicts):
:attr:`step` beginning from `start`.
Note that non-integer :attr:`step` is subject to floating point rounding errors when
comparing against :attr:`end`; to avoid inconsistency, we advise adding a small epsilon to :attr:`end`
comparing against :attr:`end`; to avoid inconsistency, we advise subtracting a small epsilon from :attr:`end`
in such cases.
.. math::
Expand Down

0 comments on commit c11441f

Please sign in to comment.