@@ -18,6 +18,7 @@ TEST(Converters, ATenDivConvertsCorrectly) {
1818  pointwise_test_helper (graph, false , false , {4 }, {3 , 4 });
1919  pointwise_test_helper (graph, false , true , {3 , 4 , 3 }, {4 , 3 });
2020  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 );
2122}
2223
2324TEST (Converters, ATenDivWithScalarConvertsCorrectly) {
@@ -29,6 +30,16 @@ TEST(Converters, ATenDivWithScalarConvertsCorrectly) {
2930  pointwise_test_helper (graph, true );
3031}
3132
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+ 
3243TEST (Converters, ATenDivRoundingFloorConvertsCorrectly) {
3344  const  auto  graph = R"IR( 
3445      graph(%0 : Tensor, %1 : Tensor): 
@@ -42,6 +53,7 @@ TEST(Converters, ATenDivRoundingFloorConvertsCorrectly) {
4253  pointwise_test_helper (graph, false , true , {4 , 3 }, {3 , 4 , 3 }, true );
4354  pointwise_test_helper (graph, false , true , {5 }, {5 }, false , at::kFloat , at::kInt );
4455  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 );
4557}
4658
4759TEST (Converters, ATenDivRoundingTruncConvertsCorrectly) {
@@ -57,6 +69,7 @@ TEST(Converters, ATenDivRoundingTruncConvertsCorrectly) {
5769  pointwise_test_helper (graph, false , true , {4 , 3 }, {3 , 4 , 3 }, true );
5870  pointwise_test_helper (graph, false , true , {5 }, {5 }, false , at::kFloat , at::kInt );
5971  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 );
6073}
6174
6275TEST (Converters, ATenDivRoundingNoneConvertsCorrectly) {
@@ -70,6 +83,7 @@ TEST(Converters, ATenDivRoundingNoneConvertsCorrectly) {
7083  pointwise_test_helper (graph, false , false , {4 }, {3 , 4 }, true );
7184  pointwise_test_helper (graph, false , true , {3 , 4 , 3 }, {4 , 3 }, true );
7285  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 );
7387}
7488
7589TEST (Converters, ATenDivRoundingTruncWithIntsConvertsCorrectly) {
@@ -107,6 +121,7 @@ TEST(Converters, ATenFloorDivideConvertsCorrectly) {
107121  pointwise_test_helper (graph, false , true , {4 , 3 }, {3 , 4 , 3 });
108122  pointwise_test_helper (graph, false , true , {5 }, {5 }, false , at::kFloat , at::kInt );
109123  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 );
110125}
111126
112127TEST (Converters, ATenFloorDivideWithScalarConvertsCorrectly) {
0 commit comments