-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support aten.atan2.out converter
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
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 TestAtan2OutConverter(DispatchTestCase): | ||
@parameterized.expand( | ||
[ | ||
((10,), (5,), torch.float), | ||
((10,), (10,), torch.float), | ||
] | ||
) | ||
def test_atan2_float(self, input_shape, out_shape, dtype): | ||
class atan2_out(nn.Module): | ||
def forward(self, lhs_val, rhs_val, out): | ||
return torch.ops.aten.atan2.out(lhs_val, rhs_val, out=out) | ||
|
||
out = torch.empty(out_shape) | ||
|
||
inputs = [ | ||
torch.randn(input_shape, dtype=dtype), | ||
torch.randn(input_shape, dtype=dtype), | ||
out, | ||
] | ||
|
||
self.run_test( | ||
atan2_out(), | ||
inputs, | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
run_tests() |