Skip to content

Commit

Permalink
Added simple tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gkrivor committed Apr 26, 2024
1 parent 52e7069 commit 90a768b
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/frontends/onnx/tests/models/int4_const.prototxt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
ir_version: 10
producer_name: "OpenVINO ONNX Frontend"
graph {
name: "test"
node {
output: "Y"
op_type: "Constant"
attribute {
name: "value"
t {
dims: 4
data_type: 22
int32_data: 15
int32_data: 113
name: "int4_const"
}
type: TENSOR
}
}
node {
input: "Y"
output: "O"
op_type: "Shape"
}
output {
name: "O"
type {
tensor_type {
elem_type: 7
shape {
dim {
dim_value: 1
}
}
}
}
}
}
opset_import {
version: 21
}
41 changes: 41 additions & 0 deletions src/frontends/onnx/tests/models/uint4_const.prototxt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
ir_version: 10
producer_name: "OpenVINO ONNX Frontend"
graph {
name: "test"
node {
output: "Y"
op_type: "Constant"
attribute {
name: "value"
t {
dims: 4
data_type: 21
int32_data: 16
int32_data: 248
name: "uint4_const"
}
type: TENSOR
}
}
node {
input: "Y"
output: "O"
op_type: "Shape"
}
output {
name: "O"
type {
tensor_type {
elem_type: 7
shape {
dim {
dim_value: 1
}
}
}
}
}
}
opset_import {
version: 21
}
16 changes: 16 additions & 0 deletions src/frontends/onnx/tests/onnx_import.in.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,22 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_bool_init_raw) {
test_case.run();
}

OPENVINO_TEST(${BACKEND_NAME}, onnx_int4_const) {
auto model = convert_model("int4_const.onnx");

auto test_case = ov::test::TestCase(model, s_device);
test_case.add_expected_output(std::vector<int64_t>{4});
test_case.run();
}

OPENVINO_TEST(${BACKEND_NAME}, onnx_uint4_const) {
auto model = convert_model("uint4_const.onnx");

auto test_case = ov::test::TestCase(model, s_device);
test_case.add_expected_output(std::vector<int64_t>{4});
test_case.run();
}

OPENVINO_TEST(${BACKEND_NAME}, onnx_model_add_abc_initializers) {
auto model = convert_model("add_abc_initializers.onnx");

Expand Down

0 comments on commit 90a768b

Please sign in to comment.