Skip to content

Commit

Permalink
fix(tests): Fix broken elementwise tests
Browse files Browse the repository at this point in the history
Signed-off-by: Naren Dasan <naren@narendasan.com>
Signed-off-by: Naren Dasan <narens@nvidia.com>
  • Loading branch information
narendasan committed Feb 4, 2021
1 parent bc4aeb7 commit 22ed944
Showing 1 changed file with 102 additions and 102 deletions.
204 changes: 102 additions & 102 deletions tests/core/conversion/converters/test_element_wise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,117 +238,117 @@ TEST(Converters, ATenRsubWithScalarConvertsCorrectly) {
pointwise_test_helper(graph, true, false, {4, 3, 3, 3});
}

TEST(Converters, ATenClampMinConvertsCorrectly) {
const auto graph = R"IR(
graph(%x.1 : Tensor):
%2 : int = prim::Constant[value=-2]()
%3 : None = prim::Constant()
%4 : Tensor = aten::clamp(%x.1, %2, %3)
return (%4))IR";
pointwise_test_helper(graph, true);
}
TEST(Converters, ATenClampMinConvertsCorrectly) {
const auto graph = R"IR(
graph(%x.1 : Tensor):
%2 : int = prim::Constant[value=-2]()
%3 : None = prim::Constant()
%4 : Tensor = aten::clamp(%x.1, %2, %3)
return (%4))IR";
pointwise_test_helper(graph, true);
}

TEST(Converters, ATenClampMaxConvertsCorrectly) {
const auto graph = R"IR(
graph(%x.1 : Tensor):
%2 : int = prim::Constant[value=3]()
%3 : None = prim::Constant()
%4 : Tensor = aten::clamp(%x.1, %3, %2)
return (%4))IR";
pointwise_test_helper(graph, true);
}
TEST(Converters, ATenClampMaxConvertsCorrectly) {
const auto graph = R"IR(
graph(%x.1 : Tensor):
%2 : int = prim::Constant[value=3]()
%3 : None = prim::Constant()
%4 : Tensor = aten::clamp(%x.1, %3, %2)
return (%4))IR";
pointwise_test_helper(graph, true);
}

TEST(Converters, ATenClampMinMaxConvertsCorrectly) {
const auto graph = R"IR(
graph(%x.1 : Tensor):
%2 : int = prim::Constant[value=3]()
%3 : int = prim::Constant[value=-2]()
%4 : Tensor = aten::clamp(%x.1, %3, %2)
return (%4))IR";
pointwise_test_helper(graph, true);
}
TEST(Converters, ATenClampMinMaxConvertsCorrectly) {
const auto graph = R"IR(
graph(%x.1 : Tensor):
%2 : int = prim::Constant[value=3]()
%3 : int = prim::Constant[value=-2]()
%4 : Tensor = aten::clamp(%x.1, %3, %2)
return (%4))IR";
pointwise_test_helper(graph, true);
}

TEST(Converters, ATenGreaterThanConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::gt(%0, %1)
return (%2))IR";
pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
}
TEST(Converters, ATenGreaterThanConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::gt(%0, %1)
return (%2))IR";
pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
}

TEST(Converters, ATenGreaterThanScalarConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::gt(%0, %scalar)
return (%2))IR";
pointwise_test_helper(graph, true, false, {5, 5});
}
TEST(Converters, ATenGreaterThanScalarConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::gt(%0, %scalar)
return (%2))IR";
pointwise_test_helper(graph, true, false, {5, 5});
}

TEST(Converters, ATenLessThanConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::lt(%0, %1)
return (%2))IR";
pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
}
TEST(Converters, ATenLessThanConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::lt(%0, %1)
return (%2))IR";
pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
}

TEST(Converters, ATenLessThanScalarConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::lt(%0, %scalar)
return (%2))IR";
pointwise_test_helper(graph, true, false, {5, 5});
}
TEST(Converters, ATenLessThanScalarConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::lt(%0, %scalar)
return (%2))IR";
pointwise_test_helper(graph, true, false, {5, 5});
}

TEST(Converters, ATenEqualConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::eq(%0, %1)
return (%2))IR";
pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
}
TEST(Converters, ATenEqualConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::eq(%0, %1)
return (%2))IR";
pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
}

TEST(Converters, ATenEqualScalarConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::eq(%0, %scalar)
return (%2))IR";
pointwise_test_helper(graph, true, false, {5, 5});
}
TEST(Converters, ATenEqualScalarConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::eq(%0, %scalar)
return (%2))IR";
pointwise_test_helper(graph, true, false, {5, 5});
}

TEST(Converters, ATenGEConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::ge(%0, %1)
return (%2))IR";
pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
}
TEST(Converters, ATenGEConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::ge(%0, %1)
return (%2))IR";
pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
}

TEST(Converters, ATenGEScalarConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::ge(%0, %scalar)
return (%2))IR";
pointwise_test_helper(graph, true, false, {5, 5});
}
TEST(Converters, ATenGEScalarConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::ge(%0, %scalar)
return (%2))IR";
pointwise_test_helper(graph, true, false, {5, 5});
}

TEST(Converters, ATenLEConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::le(%0, %1)
return (%2))IR";
pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
}
TEST(Converters, ATenLEConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor, %1 : Tensor):
%2 : Tensor = aten::le(%0, %1)
return (%2))IR";
pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
}

TEST(Converters, ATenLEScalarConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::le(%0, %scalar)
return (%2))IR";
pointwise_test_helper(graph, true, false, {5, 5});
}
TEST(Converters, ATenLEScalarConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor):
%scalar : float = prim::Constant[value=3]()
%2 : Tensor = aten::le(%0, %scalar)
return (%2))IR";
pointwise_test_helper(graph, true, false, {5, 5});
}

0 comments on commit 22ed944

Please sign in to comment.