Commit 54db6552 authored by Tomasz Dołbniak's avatar Tomasz Dołbniak Committed by Scott Cyphers

[ONNX] Erf test for integer values (#2778)

* [ONNX] Erf test for integer values

* [ONNX] switch off model_erf_int32 test on GPU
parent ab9fad24
......@@ -137,6 +137,7 @@ create_tensor_2_output
erf
zero_sized_erf
model_erf
model_erf_int32
gather_no_axis
gather
gather_nd_scalar_from_2d
......
ir_version: 3
producer_name: "nGraph ONNX Importer"
graph {
node {
input: "x"
output: "y"
op_type: "Erf"
}
name: "erf_graph"
input {
name: "x"
type {
tensor_type {
elem_type: 6
shape {
dim {
dim_value: 5
}
}
}
}
}
output {
name: "y"
type {
tensor_type {
elem_type: 6
shape {
dim {
dim_value: 5
}
}
}
}
}
}
opset_import {
version: 9
}
......@@ -2849,3 +2849,18 @@ NGRAPH_TEST(onnx_${BACKEND_NAME}, model_erf)
EXPECT_TRUE(test::all_close_f(expected_outputs, outputs.front()));
}
NGRAPH_TEST(onnx_${BACKEND_NAME}, model_erf_int32)
{
const auto function = onnx_import::import_onnx_model(
file_util::path_join(SERIALIZED_ZOO, "onnx/erf_int32.prototxt"));
const std::vector<std::vector<int32_t>> inputs{
{-std::numeric_limits<int32_t>::max(), -1, 0, 1, std::numeric_limits<int32_t>::max()}};
const std::vector<int32_t> expected_outputs{-1, 0, 0, 0, 1};
const std::vector<std::vector<int32_t>> outputs{execute(function, inputs, "${BACKEND_NAME}")};
EXPECT_TRUE(test::all_close(expected_outputs, outputs.front()));
}
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