-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add TorchLog1pVisitor #77
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import torch | ||
a = torch.randn(5) | ||
b = torch.log(1 + a) | ||
c = torch.log(a + 1) | ||
b = torch.log(1.0 + a) | ||
c = torch.log(a + 1.0) | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
3:5 TOR106 Use `torch.log1p(x)` instead of `torch.log(1 + x)`. It is more accurate for small values of `x`. | ||
4:5 TOR106 Use `torch.log1p(x)` instead of `torch.log(1 + x)`. It is more accurate for small values of `x`. | ||
5:5 TOR106 Use `torch.log1p(x)` instead of `torch.log(1 + x)`. It is more accurate for small values of `x`. | ||
6:5 TOR106 Use `torch.log1p(x)` instead of `torch.log(1 + x)`. It is more accurate for small values of `x`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
|
||
from .visitors import ( | ||
TorchDeprecatedSymbolsVisitor, | ||
TorchLog1pVisitor, | ||
TorchNonPublicAliasVisitor, | ||
TorchReentrantCheckpointVisitor, | ||
TorchRequireGradVisitor, | ||
|
@@ -28,15 +29,16 @@ | |
|
||
ALL_VISITOR_CLS = [ | ||
TorchDeprecatedSymbolsVisitor, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any ideas how to avoid this ugly duplication of all visitors? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we can automatically pick them up with a registry pattern. Already got something in progress for this. |
||
TorchLog1pVisitor, | ||
TorchNonPublicAliasVisitor, | ||
TorchRequireGradVisitor, | ||
TorchReentrantCheckpointVisitor, | ||
TorchScopedLibraryVisitor, | ||
TorchSynchronizedDataLoaderVisitor, | ||
TorchUnsafeLoadVisitor, | ||
TorchVisionDeprecatedPretrainedVisitor, | ||
TorchVisionDeprecatedToTensorVisitor, | ||
TorchVisionSingletonImportVisitor, | ||
TorchUnsafeLoadVisitor, | ||
TorchReentrantCheckpointVisitor, | ||
TorchNonPublicAliasVisitor, | ||
] | ||
|
||
|
||
|
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.
Could we already add Array API examples here? We don't have the capability of automatically detecting them at the moment, but it's good to be explicit about the known false negatives, especially when we can catch them later
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.
Added a false negative.