-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Closed
Copy link
Labels
module: docsRelated to our documentation, both in docs/ and docblocksRelated to our documentation, both in docs/ and docblockstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
π The doc issue
The doc of isclose() shows the parameters in order as shown below:
torch.isclose(input, other, rtol=1e-05, atol=1e-08, equal_nan=False) β Tensor
And, the formula is explained as shown below:
|input - other| <= atol + rtol x |other|
But rtol parameter is explained after atol parameter as shown below:
Parameters
- input (Tensor) β first tensor to compare
- other (Tensor) β second tensor to compare
- atol (float, optional) β absolute tolerance. Default: 1e-08
- rtol (float, optional) β relative tolerance. Default: 1e-05 <- Here
- equal_nan (bool, optional) β if True, then two NaN s will be considered equal. Default: False
Suggest a potential alternative/fix
So, But rtol parameter should be explained before atol parameter in order as shown below:
Parameters
- input (Tensor) β first tensor to compare
- other (Tensor) β second tensor to compare
- rtol (float, optional) β relative tolerance. Default: 1e-05 <- Here
- atol (float, optional) β absolute tolerance. Default: 1e-08
- equal_nan (bool, optional) β if True, then two NaN s will be considered equal. Default: False
In addition, the formula is better to be as shown below so that we can easily understand it:
|input - other| <= rtol x |other| + atol
Metadata
Metadata
Assignees
Labels
module: docsRelated to our documentation, both in docs/ and docblocksRelated to our documentation, both in docs/ and docblockstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module