Commit 5d2a7d1c authored by Michał Karzyński's avatar Michał Karzyński Committed by Sang Ik Lee

[ONNX] Enable softplus tests (#2335)

* [ONNX] Enable softplus tests

* style-apply
parent c6e2fe35
...@@ -1541,7 +1541,7 @@ TEST(onnx_${BACKEND_NAME}, model_matmul_vec_ten3d) ...@@ -1541,7 +1541,7 @@ TEST(onnx_${BACKEND_NAME}, model_matmul_vec_ten3d)
EXPECT_TRUE(test::all_close_f(expected_output.front(), outputs.front())); EXPECT_TRUE(test::all_close_f(expected_output.front(), outputs.front()));
} }
TEST(onnx_${BACKEND_NAME}, DISABLED_model_softplus) TEST(onnx_${BACKEND_NAME}, model_softplus)
{ {
auto function = auto function =
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/softplus.onnx")); onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/softplus.onnx"));
...@@ -1582,12 +1582,14 @@ TEST(onnx_${BACKEND_NAME}, DISABLED_model_softplus) ...@@ -1582,12 +1582,14 @@ TEST(onnx_${BACKEND_NAME}, DISABLED_model_softplus)
Outputs expected_output{output}; Outputs expected_output{output};
Outputs outputs{execute(function, inputs, "${BACKEND_NAME}")}; Outputs outputs{execute(function, inputs, "${BACKEND_NAME}")};
EXPECT_TRUE(test::all_close_f(expected_output.front(), outputs.front())); EXPECT_TRUE(test::all_close_f(expected_output.front(), outputs.front()));
}
inputs.clear(); TEST(onnx_${BACKEND_NAME}, model_softplus_infinity)
outputs.clear(); {
expected_output.clear(); auto function =
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/softplus.onnx"));
inputs.emplace_back(std::vector<float>{std::numeric_limits<float>::infinity(), Inputs inputs{std::vector<float>{std::numeric_limits<float>::infinity(),
std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(),
std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(),
std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(),
...@@ -1599,10 +1601,9 @@ TEST(onnx_${BACKEND_NAME}, DISABLED_model_softplus) ...@@ -1599,10 +1601,9 @@ TEST(onnx_${BACKEND_NAME}, DISABLED_model_softplus)
std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(),
std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(),
std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(),
std::numeric_limits<float>::infinity()}); std::numeric_limits<float>::infinity()}};
input = inputs.back();
outputs = execute(function, inputs, "${BACKEND_NAME}");
Outputs outputs{execute(function, inputs, "${BACKEND_NAME}")};
for (float v : outputs.front()) for (float v : outputs.front())
{ {
EXPECT_TRUE(std::isinf(v)); EXPECT_TRUE(std::isinf(v));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment