-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support dds and nonzero op in _PythonTorchTensorRTModule
- Loading branch information
Showing
6 changed files
with
90 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import torch | ||
import torch.nn as nn | ||
from parameterized import parameterized | ||
from torch.testing._internal.common_utils import run_tests | ||
|
||
from .harness import DispatchTestCase | ||
|
||
|
||
class TestAtanConverter(DispatchTestCase): | ||
@parameterized.expand( | ||
[ | ||
((10,), torch.int), | ||
((1, 20), torch.int32), | ||
((5, 3), torch.int64), | ||
((2, 3, 4), torch.float), | ||
((2, 3, 4, 5), torch.float), | ||
] | ||
) | ||
def test_atan_float(self, input_shape, dtype): | ||
class atan(nn.Module): | ||
def forward(self, input): | ||
return torch.ops.aten.nonzero.default(input) | ||
|
||
inputs = [torch.randint(low=0, high=3, size=input_shape, dtype=dtype)] | ||
self.run_test( | ||
atan(), | ||
inputs, | ||
propagate_shapes=True, # it requires propagate_shapes=True to get output shapes | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
run_tests() |