@@ -18,6 +18,7 @@ TEST(Converters, ATenDivConvertsCorrectly) {
18
18
pointwise_test_helper (graph, false , false , {4 }, {3 , 4 });
19
19
pointwise_test_helper (graph, false , true , {3 , 4 , 3 }, {4 , 3 });
20
20
pointwise_test_helper (graph, false , true , {4 , 3 }, {3 , 4 , 3 });
21
+ pointwise_test_helper (graph, false , true , {5 }, {5 }, false , at::kInt , at::kInt );
21
22
}
22
23
23
24
TEST (Converters, ATenDivWithScalarConvertsCorrectly) {
@@ -29,6 +30,16 @@ TEST(Converters, ATenDivWithScalarConvertsCorrectly) {
29
30
pointwise_test_helper (graph, true );
30
31
}
31
32
33
+ TEST (Converters, ATenDivWithScalarIntConvertsCorrectly) {
34
+ const auto graph = R"IR(
35
+ graph(%0 : Tensor):
36
+ %scalar : int = prim::Constant[value=2]()
37
+ %1 : Tensor = aten::div(%0, %scalar)
38
+ return (%1))IR" ;
39
+ pointwise_test_helper (graph, true );
40
+ pointwise_test_helper (graph, true , false , {5 }, {1 }, false , at::kInt );
41
+ }
42
+
32
43
TEST (Converters, ATenDivRoundingFloorConvertsCorrectly) {
33
44
const auto graph = R"IR(
34
45
graph(%0 : Tensor, %1 : Tensor):
@@ -42,6 +53,7 @@ TEST(Converters, ATenDivRoundingFloorConvertsCorrectly) {
42
53
pointwise_test_helper (graph, false , true , {4 , 3 }, {3 , 4 , 3 }, true );
43
54
pointwise_test_helper (graph, false , true , {5 }, {5 }, false , at::kFloat , at::kInt );
44
55
pointwise_test_helper (graph, false , true , {5 }, {5 }, false , at::kInt , at::kFloat );
56
+ pointwise_test_helper (graph, false , true , {5 }, {5 }, false , at::kInt , at::kInt );
45
57
}
46
58
47
59
TEST (Converters, ATenDivRoundingTruncConvertsCorrectly) {
@@ -57,6 +69,7 @@ TEST(Converters, ATenDivRoundingTruncConvertsCorrectly) {
57
69
pointwise_test_helper (graph, false , true , {4 , 3 }, {3 , 4 , 3 }, true );
58
70
pointwise_test_helper (graph, false , true , {5 }, {5 }, false , at::kFloat , at::kInt );
59
71
pointwise_test_helper (graph, false , true , {5 }, {5 }, false , at::kInt , at::kFloat );
72
+ pointwise_test_helper (graph, false , true , {5 }, {5 }, false , at::kInt , at::kInt );
60
73
}
61
74
62
75
TEST (Converters, ATenDivRoundingNoneConvertsCorrectly) {
@@ -70,6 +83,7 @@ TEST(Converters, ATenDivRoundingNoneConvertsCorrectly) {
70
83
pointwise_test_helper (graph, false , false , {4 }, {3 , 4 }, true );
71
84
pointwise_test_helper (graph, false , true , {3 , 4 , 3 }, {4 , 3 }, true );
72
85
pointwise_test_helper (graph, false , true , {4 , 3 }, {3 , 4 , 3 }, true );
86
+ pointwise_test_helper (graph, false , true , {5 }, {5 }, false , at::kInt , at::kInt );
73
87
}
74
88
75
89
TEST (Converters, ATenDivRoundingTruncWithIntsConvertsCorrectly) {
@@ -107,6 +121,7 @@ TEST(Converters, ATenFloorDivideConvertsCorrectly) {
107
121
pointwise_test_helper (graph, false , true , {4 , 3 }, {3 , 4 , 3 });
108
122
pointwise_test_helper (graph, false , true , {5 }, {5 }, false , at::kFloat , at::kInt );
109
123
pointwise_test_helper (graph, false , true , {5 }, {5 }, false , at::kInt , at::kFloat );
124
+ pointwise_test_helper (graph, false , true , {5 }, {5 }, false , at::kInt , at::kInt );
110
125
}
111
126
112
127
TEST (Converters, ATenFloorDivideWithScalarConvertsCorrectly) {
0 commit comments