[ONNX] Add Scan operator to ONNX Frontend (#11053)
This commit is contained in:
parent
e1cd7bfc5b
commit
5bedbbe05d
@ -29,8 +29,6 @@ skip_issue_67415 = pytest.mark.skip(reason="RuntimeError: Unsupported data type
|
||||
xfail_issue_67415 = xfail_test(reason="RuntimeError: Unsupported data type for when filling blob!")
|
||||
xfail_issue_33488 = xfail_test(reason="RuntimeError: nGraph does not support the following ONNX operations: "
|
||||
"MaxUnpool")
|
||||
xfail_issue_33538 = xfail_test(reason="RuntimeError: nGraph does not support the following ONNX operations: "
|
||||
"Scan")
|
||||
skip_issue_38084 = pytest.mark.skip(reason="Aborted (core dumped) Assertion "
|
||||
"`(layer->get_output_partial_shape(i).is_static())' failed.")
|
||||
xfail_issue_33589 = xfail_test(reason="nGraph does not support the following ONNX operations: "
|
||||
|
@ -8,7 +8,6 @@ from tests import (
|
||||
BACKEND_NAME,
|
||||
skip_rng_tests,
|
||||
xfail_issue_33488,
|
||||
xfail_issue_33538,
|
||||
xfail_issue_33581,
|
||||
xfail_issue_33589,
|
||||
xfail_issue_33595,
|
||||
@ -198,11 +197,6 @@ tests_expected_to_fail = [
|
||||
xfail_issue_38706,
|
||||
"OnnxBackendNodeModelTest.test_split_zero_size_splits_cpu",
|
||||
),
|
||||
(
|
||||
xfail_issue_33538,
|
||||
"OnnxBackendNodeModelTest.test_scan_sum_cpu",
|
||||
"OnnxBackendNodeModelTest.test_scan9_sum_cpu",
|
||||
),
|
||||
(
|
||||
xfail_issue_33581,
|
||||
"OnnxBackendNodeModelTest.test_gather_elements_negative_indices_cpu",
|
||||
|
@ -28,8 +28,6 @@ xfail_issue_69444 = xfail_test(reason="ONNX Resize - AssertionError: Mismatched
|
||||
xfail_issue_67415 = xfail_test(reason="RuntimeError: Unsupported data type for when filling blob!")
|
||||
xfail_issue_33488 = xfail_test(reason="RuntimeError: nGraph does not support the following ONNX operations: "
|
||||
"MaxUnpool")
|
||||
xfail_issue_33538 = xfail_test(reason="RuntimeError: nGraph does not support the following ONNX operations: "
|
||||
"Scan")
|
||||
skip_issue_38084 = pytest.mark.skip(reason="Aborted (core dumped) Assertion "
|
||||
"`(layer->get_output_partial_shape(i).is_static())' failed.")
|
||||
xfail_issue_33589 = xfail_test(reason="nGraph does not support the following ONNX operations: "
|
||||
|
@ -8,7 +8,6 @@ from tests_compatibility import (
|
||||
BACKEND_NAME,
|
||||
skip_rng_tests,
|
||||
xfail_issue_33488,
|
||||
xfail_issue_33538,
|
||||
xfail_issue_33581,
|
||||
xfail_issue_33589,
|
||||
xfail_issue_33595,
|
||||
@ -199,11 +198,6 @@ tests_expected_to_fail = [
|
||||
xfail_issue_38706,
|
||||
"OnnxBackendNodeModelTest.test_split_zero_size_splits_cpu",
|
||||
),
|
||||
(
|
||||
xfail_issue_33538,
|
||||
"OnnxBackendNodeModelTest.test_scan_sum_cpu",
|
||||
"OnnxBackendNodeModelTest.test_scan9_sum_cpu",
|
||||
),
|
||||
(
|
||||
xfail_issue_33581,
|
||||
"OnnxBackendNodeModelTest.test_gather_elements_negative_indices_cpu",
|
||||
|
346
src/core/tests/models/onnx/scan15_ND_b4_input_rev.prototxt
Normal file
346
src/core/tests/models/onnx/scan15_ND_b4_input_rev.prototxt
Normal file
@ -0,0 +1,346 @@
|
||||
ir_version: 8
|
||||
producer_name: "onnx-frontend-test"
|
||||
graph {
|
||||
node {
|
||||
input: "initial"
|
||||
input: "initial_next"
|
||||
input: "seq_mul"
|
||||
input: "seq_div"
|
||||
output: "scan_end_sum"
|
||||
output: "scan_end_sum_next"
|
||||
output: "scan_seq"
|
||||
op_type: "Scan"
|
||||
attribute {
|
||||
name: "body"
|
||||
g {
|
||||
node {
|
||||
input: "previous"
|
||||
input: "next"
|
||||
output: "sum"
|
||||
op_type: "Add"
|
||||
}
|
||||
node {
|
||||
input: "sum"
|
||||
input: "div_factor"
|
||||
output: "div_sum"
|
||||
op_type: "Div"
|
||||
}
|
||||
node {
|
||||
input: "div_sum"
|
||||
input: "mul_factor"
|
||||
output: "multiplied_sum"
|
||||
op_type: "Mul"
|
||||
}
|
||||
node {
|
||||
input: "multiplied_sum"
|
||||
output: "state_next"
|
||||
op_type: "Identity"
|
||||
}
|
||||
node {
|
||||
input: "next"
|
||||
output: "state_previous"
|
||||
op_type: "Identity"
|
||||
}
|
||||
name: "body"
|
||||
input {
|
||||
name: "previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "mul_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "div_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "multiplied_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: GRAPH
|
||||
}
|
||||
attribute {
|
||||
name: "num_scan_inputs"
|
||||
i: 2
|
||||
type: INT
|
||||
}
|
||||
attribute {
|
||||
name: "scan_input_axes"
|
||||
ints: 1
|
||||
ints: 1
|
||||
type: INTS
|
||||
}
|
||||
attribute {
|
||||
name: "scan_input_directions"
|
||||
ints: 1
|
||||
ints: 0
|
||||
type: INTS
|
||||
}
|
||||
}
|
||||
name: "test-model-scan"
|
||||
input {
|
||||
name: "initial"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "initial_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "seq_mul"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 5
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "seq_div"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 5
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_seq"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
opset_import {
|
||||
domain: ""
|
||||
version: 15
|
||||
}
|
356
src/core/tests/models/onnx/scan15_ND_mixed.prototxt
Normal file
356
src/core/tests/models/onnx/scan15_ND_mixed.prototxt
Normal file
@ -0,0 +1,356 @@
|
||||
ir_version: 8
|
||||
producer_name: "onnx-frontend-test"
|
||||
graph {
|
||||
node {
|
||||
input: "initial"
|
||||
input: "initial_next"
|
||||
input: "seq_mul"
|
||||
input: "seq_div"
|
||||
output: "scan_end_sum"
|
||||
output: "scan_end_sum_next"
|
||||
output: "scan_seq"
|
||||
op_type: "Scan"
|
||||
attribute {
|
||||
name: "body"
|
||||
g {
|
||||
node {
|
||||
input: "previous"
|
||||
input: "next"
|
||||
output: "sum"
|
||||
op_type: "Add"
|
||||
}
|
||||
node {
|
||||
input: "sum"
|
||||
input: "div_factor"
|
||||
output: "div_sum"
|
||||
op_type: "Div"
|
||||
}
|
||||
node {
|
||||
input: "div_sum"
|
||||
input: "mul_factor"
|
||||
output: "multiplied_sum"
|
||||
op_type: "Mul"
|
||||
}
|
||||
node {
|
||||
input: "multiplied_sum"
|
||||
output: "state_next"
|
||||
op_type: "Identity"
|
||||
}
|
||||
node {
|
||||
input: "next"
|
||||
output: "state_previous"
|
||||
op_type: "Identity"
|
||||
}
|
||||
name: "body"
|
||||
input {
|
||||
name: "previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "mul_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "div_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "multiplied_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: GRAPH
|
||||
}
|
||||
attribute {
|
||||
name: "num_scan_inputs"
|
||||
i: 2
|
||||
type: INT
|
||||
}
|
||||
attribute {
|
||||
name: "scan_input_axes"
|
||||
ints: 2
|
||||
ints: 1
|
||||
type: INTS
|
||||
}
|
||||
attribute {
|
||||
name: "scan_input_directions"
|
||||
ints: 1
|
||||
ints: 0
|
||||
type: INTS
|
||||
}
|
||||
attribute {
|
||||
name: "scan_output_axes"
|
||||
ints: 3
|
||||
type: INTS
|
||||
}
|
||||
attribute {
|
||||
name: "scan_output_directions"
|
||||
ints: 1
|
||||
type: INTS
|
||||
}
|
||||
}
|
||||
name: "test-model-scan"
|
||||
input {
|
||||
name: "initial"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "initial_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "seq_mul"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 5
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "seq_div"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 5
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_seq"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
opset_import {
|
||||
domain: ""
|
||||
version: 15
|
||||
}
|
356
src/core/tests/models/onnx/scan15_ND_mixed_neg_axes.prototxt
Normal file
356
src/core/tests/models/onnx/scan15_ND_mixed_neg_axes.prototxt
Normal file
@ -0,0 +1,356 @@
|
||||
ir_version: 8
|
||||
producer_name: "onnx-frontend-test"
|
||||
graph {
|
||||
node {
|
||||
input: "initial"
|
||||
input: "initial_next"
|
||||
input: "seq_mul"
|
||||
input: "seq_div"
|
||||
output: "scan_end_sum"
|
||||
output: "scan_end_sum_next"
|
||||
output: "scan_seq"
|
||||
op_type: "Scan"
|
||||
attribute {
|
||||
name: "body"
|
||||
g {
|
||||
node {
|
||||
input: "previous"
|
||||
input: "next"
|
||||
output: "sum"
|
||||
op_type: "Add"
|
||||
}
|
||||
node {
|
||||
input: "sum"
|
||||
input: "div_factor"
|
||||
output: "div_sum"
|
||||
op_type: "Div"
|
||||
}
|
||||
node {
|
||||
input: "div_sum"
|
||||
input: "mul_factor"
|
||||
output: "multiplied_sum"
|
||||
op_type: "Mul"
|
||||
}
|
||||
node {
|
||||
input: "multiplied_sum"
|
||||
output: "state_next"
|
||||
op_type: "Identity"
|
||||
}
|
||||
node {
|
||||
input: "next"
|
||||
output: "state_previous"
|
||||
op_type: "Identity"
|
||||
}
|
||||
name: "body"
|
||||
input {
|
||||
name: "previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "mul_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "div_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "multiplied_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: GRAPH
|
||||
}
|
||||
attribute {
|
||||
name: "num_scan_inputs"
|
||||
i: 2
|
||||
type: INT
|
||||
}
|
||||
attribute {
|
||||
name: "scan_input_axes"
|
||||
ints: 2
|
||||
ints: -3
|
||||
type: INTS
|
||||
}
|
||||
attribute {
|
||||
name: "scan_input_directions"
|
||||
ints: 1
|
||||
ints: 0
|
||||
type: INTS
|
||||
}
|
||||
attribute {
|
||||
name: "scan_output_axes"
|
||||
ints: -1
|
||||
type: INTS
|
||||
}
|
||||
attribute {
|
||||
name: "scan_output_directions"
|
||||
ints: 1
|
||||
type: INTS
|
||||
}
|
||||
}
|
||||
name: "test-model-scan"
|
||||
input {
|
||||
name: "initial"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "initial_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "seq_mul"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 5
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "seq_div"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 5
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_seq"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
opset_import {
|
||||
domain: ""
|
||||
version: 15
|
||||
}
|
193
src/core/tests/models/onnx/scan15_dyn_rank.prototxt
Normal file
193
src/core/tests/models/onnx/scan15_dyn_rank.prototxt
Normal file
@ -0,0 +1,193 @@
|
||||
ir_version: 8
|
||||
producer_name: "onnx-frontend-test"
|
||||
graph {
|
||||
node {
|
||||
input: "initial"
|
||||
input: "initial_next"
|
||||
input: "seq_mul"
|
||||
input: "seq_div"
|
||||
output: "scan_end_sum"
|
||||
output: "scan_end_sum_next"
|
||||
output: "scan_seq"
|
||||
op_type: "Scan"
|
||||
attribute {
|
||||
name: "body"
|
||||
g {
|
||||
node {
|
||||
input: "previous"
|
||||
input: "next"
|
||||
output: "sum"
|
||||
op_type: "Add"
|
||||
}
|
||||
node {
|
||||
input: "sum"
|
||||
input: "div_factor"
|
||||
output: "div_sum"
|
||||
op_type: "Div"
|
||||
}
|
||||
node {
|
||||
input: "div_sum"
|
||||
input: "mul_factor"
|
||||
output: "multiplied_sum"
|
||||
op_type: "Mul"
|
||||
}
|
||||
node {
|
||||
input: "multiplied_sum"
|
||||
output: "state_next"
|
||||
op_type: "Identity"
|
||||
}
|
||||
node {
|
||||
input: "next"
|
||||
output: "state_previous"
|
||||
op_type: "Identity"
|
||||
}
|
||||
name: "body"
|
||||
input {
|
||||
name: "previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "mul_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "div_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "multiplied_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: GRAPH
|
||||
}
|
||||
attribute {
|
||||
name: "num_scan_inputs"
|
||||
i: 2
|
||||
type: INT
|
||||
}
|
||||
attribute {
|
||||
name: "scan_input_axes"
|
||||
ints: 2
|
||||
ints: 1
|
||||
type: INTS
|
||||
}
|
||||
attribute {
|
||||
name: "scan_input_directions"
|
||||
ints: 1
|
||||
ints: 0
|
||||
type: INTS
|
||||
}
|
||||
attribute {
|
||||
name: "scan_output_axes"
|
||||
ints: 3
|
||||
type: INTS
|
||||
}
|
||||
attribute {
|
||||
name: "scan_output_directions"
|
||||
ints: 1
|
||||
type: INTS
|
||||
}
|
||||
}
|
||||
name: "test-model-scan"
|
||||
input {
|
||||
name: "initial"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "initial_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "seq_mul"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "seq_div"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_seq"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
opset_import {
|
||||
domain: ""
|
||||
version: 15
|
||||
}
|
193
src/core/tests/models/onnx/scan15_dyn_rank_neg_axes.prototxt
Normal file
193
src/core/tests/models/onnx/scan15_dyn_rank_neg_axes.prototxt
Normal file
@ -0,0 +1,193 @@
|
||||
ir_version: 8
|
||||
producer_name: "onnx-frontend-test"
|
||||
graph {
|
||||
node {
|
||||
input: "initial"
|
||||
input: "initial_next"
|
||||
input: "seq_mul"
|
||||
input: "seq_div"
|
||||
output: "scan_end_sum"
|
||||
output: "scan_end_sum_next"
|
||||
output: "scan_seq"
|
||||
op_type: "Scan"
|
||||
attribute {
|
||||
name: "body"
|
||||
g {
|
||||
node {
|
||||
input: "previous"
|
||||
input: "next"
|
||||
output: "sum"
|
||||
op_type: "Add"
|
||||
}
|
||||
node {
|
||||
input: "sum"
|
||||
input: "div_factor"
|
||||
output: "div_sum"
|
||||
op_type: "Div"
|
||||
}
|
||||
node {
|
||||
input: "div_sum"
|
||||
input: "mul_factor"
|
||||
output: "multiplied_sum"
|
||||
op_type: "Mul"
|
||||
}
|
||||
node {
|
||||
input: "multiplied_sum"
|
||||
output: "state_next"
|
||||
op_type: "Identity"
|
||||
}
|
||||
node {
|
||||
input: "next"
|
||||
output: "state_previous"
|
||||
op_type: "Identity"
|
||||
}
|
||||
name: "body"
|
||||
input {
|
||||
name: "previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "mul_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "div_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "multiplied_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: GRAPH
|
||||
}
|
||||
attribute {
|
||||
name: "num_scan_inputs"
|
||||
i: 2
|
||||
type: INT
|
||||
}
|
||||
attribute {
|
||||
name: "scan_input_axes"
|
||||
ints: 2
|
||||
ints: -3
|
||||
type: INTS
|
||||
}
|
||||
attribute {
|
||||
name: "scan_input_directions"
|
||||
ints: 1
|
||||
ints: 0
|
||||
type: INTS
|
||||
}
|
||||
attribute {
|
||||
name: "scan_output_axes"
|
||||
ints: -1
|
||||
type: INTS
|
||||
}
|
||||
attribute {
|
||||
name: "scan_output_directions"
|
||||
ints: 1
|
||||
type: INTS
|
||||
}
|
||||
}
|
||||
name: "test-model-scan"
|
||||
input {
|
||||
name: "initial"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "initial_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "seq_mul"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "seq_div"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_seq"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
opset_import {
|
||||
domain: ""
|
||||
version: 15
|
||||
}
|
178
src/core/tests/models/onnx/scan15_fib_like.prototxt
Normal file
178
src/core/tests/models/onnx/scan15_fib_like.prototxt
Normal file
@ -0,0 +1,178 @@
|
||||
ir_version: 8
|
||||
producer_name: "onnx-frontend-test"
|
||||
graph {
|
||||
node {
|
||||
input: "initial"
|
||||
input: "initial_next"
|
||||
input: "sequence"
|
||||
output: "scan_end_sum"
|
||||
output: "scan_end_sum_next"
|
||||
output: "scan_seq"
|
||||
op_type: "Scan"
|
||||
attribute {
|
||||
name: "body"
|
||||
g {
|
||||
node {
|
||||
input: "previous"
|
||||
input: "next"
|
||||
output: "sum"
|
||||
op_type: "Add"
|
||||
}
|
||||
node {
|
||||
input: "sum"
|
||||
input: "mul_factor"
|
||||
output: "multiplied_sum"
|
||||
op_type: "Mul"
|
||||
}
|
||||
node {
|
||||
input: "multiplied_sum"
|
||||
output: "state_next"
|
||||
op_type: "Identity"
|
||||
}
|
||||
node {
|
||||
input: "next"
|
||||
output: "state_previous"
|
||||
op_type: "Identity"
|
||||
}
|
||||
name: "body"
|
||||
input {
|
||||
name: "previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "mul_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "multiplied_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: GRAPH
|
||||
}
|
||||
attribute {
|
||||
name: "num_scan_inputs"
|
||||
i: 1
|
||||
type: INT
|
||||
}
|
||||
}
|
||||
name: "test-model-scan"
|
||||
input {
|
||||
name: "initial"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "initial_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "sequence"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_seq"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
opset_import {
|
||||
domain: ""
|
||||
version: 15
|
||||
}
|
@ -0,0 +1,188 @@
|
||||
ir_version: 8
|
||||
producer_name: "onnx-frontend-test"
|
||||
graph {
|
||||
node {
|
||||
input: "initial"
|
||||
input: "initial_next"
|
||||
input: "sequence"
|
||||
output: "scan_end_sum"
|
||||
output: "scan_end_sum_next"
|
||||
output: "scan_seq"
|
||||
op_type: "Scan"
|
||||
attribute {
|
||||
name: "body"
|
||||
g {
|
||||
node {
|
||||
input: "previous"
|
||||
input: "next"
|
||||
output: "sum"
|
||||
op_type: "Add"
|
||||
}
|
||||
node {
|
||||
input: "sum"
|
||||
input: "mul_factor"
|
||||
output: "multiplied_sum"
|
||||
op_type: "Mul"
|
||||
}
|
||||
node {
|
||||
input: "multiplied_sum"
|
||||
output: "state_next"
|
||||
op_type: "Identity"
|
||||
}
|
||||
node {
|
||||
input: "next"
|
||||
output: "state_previous"
|
||||
op_type: "Identity"
|
||||
}
|
||||
name: "body"
|
||||
input {
|
||||
name: "previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "mul_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "multiplied_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: GRAPH
|
||||
}
|
||||
attribute {
|
||||
name: "num_scan_inputs"
|
||||
i: 1
|
||||
type: INT
|
||||
}
|
||||
attribute {
|
||||
name: "scan_input_directions"
|
||||
ints: 1
|
||||
type: INTS
|
||||
}
|
||||
attribute {
|
||||
name: "scan_output_directions"
|
||||
ints: 1
|
||||
type: INTS
|
||||
}
|
||||
}
|
||||
name: "test-model-scan"
|
||||
input {
|
||||
name: "initial"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "initial_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "sequence"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_seq"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
opset_import {
|
||||
domain: ""
|
||||
version: 15
|
||||
}
|
188
src/core/tests/models/onnx/scan15_fib_like_input_rev.prototxt
Normal file
188
src/core/tests/models/onnx/scan15_fib_like_input_rev.prototxt
Normal file
@ -0,0 +1,188 @@
|
||||
ir_version: 8
|
||||
producer_name: "onnx-frontend-test"
|
||||
graph {
|
||||
node {
|
||||
input: "initial"
|
||||
input: "initial_next"
|
||||
input: "sequence"
|
||||
output: "scan_end_sum"
|
||||
output: "scan_end_sum_next"
|
||||
output: "scan_seq"
|
||||
op_type: "Scan"
|
||||
attribute {
|
||||
name: "body"
|
||||
g {
|
||||
node {
|
||||
input: "previous"
|
||||
input: "next"
|
||||
output: "sum"
|
||||
op_type: "Add"
|
||||
}
|
||||
node {
|
||||
input: "sum"
|
||||
input: "mul_factor"
|
||||
output: "multiplied_sum"
|
||||
op_type: "Mul"
|
||||
}
|
||||
node {
|
||||
input: "multiplied_sum"
|
||||
output: "state_next"
|
||||
op_type: "Identity"
|
||||
}
|
||||
node {
|
||||
input: "next"
|
||||
output: "state_previous"
|
||||
op_type: "Identity"
|
||||
}
|
||||
name: "body"
|
||||
input {
|
||||
name: "previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "mul_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "multiplied_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: GRAPH
|
||||
}
|
||||
attribute {
|
||||
name: "num_scan_inputs"
|
||||
i: 1
|
||||
type: INT
|
||||
}
|
||||
attribute {
|
||||
name: "scan_input_directions"
|
||||
ints: 1
|
||||
type: INTS
|
||||
}
|
||||
attribute {
|
||||
name: "scan_output_directions"
|
||||
ints: 0
|
||||
type: INTS
|
||||
}
|
||||
}
|
||||
name: "test-model-scan"
|
||||
input {
|
||||
name: "initial"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "initial_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "sequence"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_seq"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
opset_import {
|
||||
domain: ""
|
||||
version: 15
|
||||
}
|
183
src/core/tests/models/onnx/scan15_fib_like_out_rev.prototxt
Normal file
183
src/core/tests/models/onnx/scan15_fib_like_out_rev.prototxt
Normal file
@ -0,0 +1,183 @@
|
||||
ir_version: 8
|
||||
producer_name: "onnx-frontend-test"
|
||||
graph {
|
||||
node {
|
||||
input: "initial"
|
||||
input: "initial_next"
|
||||
input: "sequence"
|
||||
output: "scan_end_sum"
|
||||
output: "scan_end_sum_next"
|
||||
output: "scan_seq"
|
||||
op_type: "Scan"
|
||||
attribute {
|
||||
name: "body"
|
||||
g {
|
||||
node {
|
||||
input: "previous"
|
||||
input: "next"
|
||||
output: "sum"
|
||||
op_type: "Add"
|
||||
}
|
||||
node {
|
||||
input: "sum"
|
||||
input: "mul_factor"
|
||||
output: "multiplied_sum"
|
||||
op_type: "Mul"
|
||||
}
|
||||
node {
|
||||
input: "multiplied_sum"
|
||||
output: "state_next"
|
||||
op_type: "Identity"
|
||||
}
|
||||
node {
|
||||
input: "next"
|
||||
output: "state_previous"
|
||||
op_type: "Identity"
|
||||
}
|
||||
name: "body"
|
||||
input {
|
||||
name: "previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "mul_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "multiplied_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: GRAPH
|
||||
}
|
||||
attribute {
|
||||
name: "num_scan_inputs"
|
||||
i: 1
|
||||
type: INT
|
||||
}
|
||||
attribute {
|
||||
name: "scan_output_directions"
|
||||
ints: 1
|
||||
type: INTS
|
||||
}
|
||||
}
|
||||
name: "test-model-scan"
|
||||
input {
|
||||
name: "initial"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "initial_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "sequence"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_seq"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
opset_import {
|
||||
domain: ""
|
||||
version: 15
|
||||
}
|
308
src/core/tests/models/onnx/scan8_ND_b4.prototxt
Normal file
308
src/core/tests/models/onnx/scan8_ND_b4.prototxt
Normal file
@ -0,0 +1,308 @@
|
||||
ir_version: 8
|
||||
producer_name: "onnx-frontend-test"
|
||||
graph {
|
||||
node {
|
||||
input: ""
|
||||
input: "initial"
|
||||
input: "initial_next"
|
||||
input: "seq_mul"
|
||||
input: "seq_div"
|
||||
output: "scan_end_sum"
|
||||
output: "scan_end_sum_next"
|
||||
output: "scan_seq"
|
||||
op_type: "Scan"
|
||||
attribute {
|
||||
name: "body"
|
||||
g {
|
||||
node {
|
||||
input: "previous"
|
||||
input: "next"
|
||||
output: "sum"
|
||||
op_type: "Add"
|
||||
}
|
||||
node {
|
||||
input: "sum"
|
||||
input: "div_factor"
|
||||
output: "div_sum"
|
||||
op_type: "Div"
|
||||
}
|
||||
node {
|
||||
input: "div_sum"
|
||||
input: "mul_factor"
|
||||
output: "multiplied_sum"
|
||||
op_type: "Mul"
|
||||
}
|
||||
node {
|
||||
input: "multiplied_sum"
|
||||
output: "state_next"
|
||||
op_type: "Identity"
|
||||
}
|
||||
node {
|
||||
input: "next"
|
||||
output: "state_previous"
|
||||
op_type: "Identity"
|
||||
}
|
||||
name: "body"
|
||||
input {
|
||||
name: "previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "mul_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "div_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "multiplied_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: GRAPH
|
||||
}
|
||||
attribute {
|
||||
name: "num_scan_inputs"
|
||||
i: 2
|
||||
type: INT
|
||||
}
|
||||
}
|
||||
name: "test-model-scan"
|
||||
input {
|
||||
name: "initial"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "initial_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "seq_mul"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 5
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "seq_div"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 5
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_seq"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
opset_import {
|
||||
domain: ""
|
||||
version: 8
|
||||
}
|
314
src/core/tests/models/onnx/scan8_ND_b4_input_rev.prototxt
Normal file
314
src/core/tests/models/onnx/scan8_ND_b4_input_rev.prototxt
Normal file
@ -0,0 +1,314 @@
|
||||
ir_version: 8
|
||||
producer_name: "onnx-frontend-test"
|
||||
graph {
|
||||
node {
|
||||
input: ""
|
||||
input: "initial"
|
||||
input: "initial_next"
|
||||
input: "seq_mul"
|
||||
input: "seq_div"
|
||||
output: "scan_end_sum"
|
||||
output: "scan_end_sum_next"
|
||||
output: "scan_seq"
|
||||
op_type: "Scan"
|
||||
attribute {
|
||||
name: "body"
|
||||
g {
|
||||
node {
|
||||
input: "previous"
|
||||
input: "next"
|
||||
output: "sum"
|
||||
op_type: "Add"
|
||||
}
|
||||
node {
|
||||
input: "sum"
|
||||
input: "div_factor"
|
||||
output: "div_sum"
|
||||
op_type: "Div"
|
||||
}
|
||||
node {
|
||||
input: "div_sum"
|
||||
input: "mul_factor"
|
||||
output: "multiplied_sum"
|
||||
op_type: "Mul"
|
||||
}
|
||||
node {
|
||||
input: "multiplied_sum"
|
||||
output: "state_next"
|
||||
op_type: "Identity"
|
||||
}
|
||||
node {
|
||||
input: "next"
|
||||
output: "state_previous"
|
||||
op_type: "Identity"
|
||||
}
|
||||
name: "body"
|
||||
input {
|
||||
name: "previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "mul_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "div_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "multiplied_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: GRAPH
|
||||
}
|
||||
attribute {
|
||||
name: "directions"
|
||||
ints: 1
|
||||
ints: 0
|
||||
type: INTS
|
||||
}
|
||||
attribute {
|
||||
name: "num_scan_inputs"
|
||||
i: 2
|
||||
type: INT
|
||||
}
|
||||
}
|
||||
name: "test-model-scan"
|
||||
input {
|
||||
name: "initial"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "initial_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "seq_mul"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 5
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "seq_div"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 5
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_seq"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
opset_import {
|
||||
domain: ""
|
||||
version: 8
|
||||
}
|
321
src/core/tests/models/onnx/scan8_ND_b4_seq_lens.prototxt
Normal file
321
src/core/tests/models/onnx/scan8_ND_b4_seq_lens.prototxt
Normal file
@ -0,0 +1,321 @@
|
||||
ir_version: 8
|
||||
producer_name: "onnx-frontend-test"
|
||||
graph {
|
||||
node {
|
||||
input: "sequence_lens"
|
||||
input: "initial"
|
||||
input: "initial_next"
|
||||
input: "seq_mul"
|
||||
input: "seq_div"
|
||||
output: "scan_end_sum"
|
||||
output: "scan_end_sum_next"
|
||||
output: "scan_seq"
|
||||
op_type: "Scan"
|
||||
attribute {
|
||||
name: "body"
|
||||
g {
|
||||
node {
|
||||
input: "previous"
|
||||
input: "next"
|
||||
output: "sum"
|
||||
op_type: "Add"
|
||||
}
|
||||
node {
|
||||
input: "sum"
|
||||
input: "div_factor"
|
||||
output: "div_sum"
|
||||
op_type: "Div"
|
||||
}
|
||||
node {
|
||||
input: "div_sum"
|
||||
input: "mul_factor"
|
||||
output: "multiplied_sum"
|
||||
op_type: "Mul"
|
||||
}
|
||||
node {
|
||||
input: "multiplied_sum"
|
||||
output: "state_next"
|
||||
op_type: "Identity"
|
||||
}
|
||||
node {
|
||||
input: "next"
|
||||
output: "state_previous"
|
||||
op_type: "Identity"
|
||||
}
|
||||
name: "body"
|
||||
input {
|
||||
name: "previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "mul_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "div_factor"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_previous"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "state_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "multiplied_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
type: GRAPH
|
||||
}
|
||||
attribute {
|
||||
name: "num_scan_inputs"
|
||||
i: 2
|
||||
type: INT
|
||||
}
|
||||
}
|
||||
name: "test-model-scan"
|
||||
input {
|
||||
name: "sequence_lens"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 7
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "initial"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "initial_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "seq_mul"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 5
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "seq_div"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 4
|
||||
}
|
||||
dim {
|
||||
dim_value: 5
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_end_sum_next"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "scan_seq"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
dim {
|
||||
dim_value: -1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
opset_import {
|
||||
domain: ""
|
||||
version: 8
|
||||
}
|
@ -4737,3 +4737,296 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_expand_failsafe_node) {
|
||||
test_case.add_expected_output<float>(input_data);
|
||||
test_case.run();
|
||||
}
|
||||
|
||||
NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_fib_like) {
|
||||
const auto function =
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/scan15_fib_like.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{}, {0});
|
||||
test_case.add_input<float>(Shape{}, {1});
|
||||
test_case.add_input<float>(Shape{10}, std::vector<float>(10, 1));
|
||||
|
||||
test_case.add_expected_output<float>(Shape{}, {55});
|
||||
test_case.add_expected_output<float>(Shape{}, {89});
|
||||
test_case.add_expected_output<float>(Shape{10}, {1., 2., 3., 5., 8., 13., 21., 34., 55., 89.});
|
||||
test_case.run();
|
||||
}
|
||||
|
||||
NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_fib_like_out_rev) {
|
||||
const auto function =
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/scan15_fib_like_out_rev.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{}, {0});
|
||||
test_case.add_input<float>(Shape{}, {1});
|
||||
test_case.add_input<float>(Shape{10}, std::vector<float>(10, 1));
|
||||
|
||||
test_case.add_expected_output<float>(Shape{}, {55});
|
||||
test_case.add_expected_output<float>(Shape{}, {89});
|
||||
test_case.add_expected_output<float>(Shape{10}, {89., 55., 34., 21., 13., 8., 5., 3., 2., 1.});
|
||||
test_case.run();
|
||||
}
|
||||
|
||||
NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_fib_like_input_rev) {
|
||||
const auto function =
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/scan15_fib_like_input_rev.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{}, {0});
|
||||
test_case.add_input<float>(Shape{}, {1});
|
||||
test_case.add_input<float>(Shape{10}, std::vector<float>{0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9});
|
||||
|
||||
test_case.add_expected_output<float>(Shape{}, {0.14897026});
|
||||
test_case.add_expected_output<float>(Shape{}, {0.});
|
||||
test_case.add_expected_output<float>(
|
||||
Shape{10},
|
||||
{0.9, 1.52, 1.694, 1.9284, 1.8112, 1.4958401, 0.9921121, 0.49759045, 0.14897026, 0.});
|
||||
test_case.run();
|
||||
}
|
||||
|
||||
NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_fib_like_input_out_rev) {
|
||||
const auto function =
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/scan15_fib_like_input_out_rev.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{}, {0});
|
||||
test_case.add_input<float>(Shape{}, {1});
|
||||
test_case.add_input<float>(Shape{10}, std::vector<float>{0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9});
|
||||
|
||||
test_case.add_expected_output<float>(Shape{}, {0.14897026});
|
||||
test_case.add_expected_output<float>(Shape{}, {0.});
|
||||
test_case.add_expected_output<float>(
|
||||
Shape{10},
|
||||
{0., 0.14897026, 0.49759045, 0.9921121, 1.4958401, 1.8112, 1.9284, 1.694, 1.52, 0.9});
|
||||
test_case.run();
|
||||
}
|
||||
|
||||
NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_ND_mixed_ones) {
|
||||
const auto function =
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/scan15_ND_mixed.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{1, 3, 2}, {0, 0, 0, 0, 0, 0});
|
||||
test_case.add_input<float>(Shape{1, 3, 2}, {1, 1, 1, 1, 1, 1});
|
||||
test_case.add_input<float>(Shape{1, 3, 5, 2}, std::vector<float>(30, 1)); // multiply by one
|
||||
test_case.add_input<float>(Shape{1, 5, 3, 2}, std::vector<float>(30, 1)); // div by one
|
||||
|
||||
test_case.add_expected_output<float>(Shape{1, 3, 2}, {5., 5., 5., 5., 5., 5.});
|
||||
test_case.add_expected_output<float>(Shape{1, 3, 2}, {8., 8., 8., 8., 8., 8.});
|
||||
test_case.add_expected_output<float>(Shape{1, 3, 2, 5},
|
||||
{8., 5., 3., 2., 1., 8., 5., 3., 2., 1., 8., 5., 3., 2., 1.,
|
||||
8., 5., 3., 2., 1., 8., 5., 3., 2., 1., 8., 5., 3., 2., 1.});
|
||||
test_case.run();
|
||||
}
|
||||
|
||||
NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_ND_mixed_vals) {
|
||||
const auto function =
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/scan15_ND_mixed.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{1, 3, 2}, {0, 0, 0, 0, 0, 0});
|
||||
test_case.add_input<float>(Shape{1, 3, 2}, {1, 1, 1, 1, 1, 1});
|
||||
std::vector<float> sequence_vals{0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2, 1.3, 1.4, 1.5,
|
||||
1.6, 1.7, 1.8, 1.9, 2., 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.};
|
||||
test_case.add_input<float>(Shape{1, 3, 5, 2}, sequence_vals); // multiply factor (reverse)
|
||||
test_case.add_input<float>(Shape{1, 5, 3, 2}, sequence_vals); // div factor
|
||||
|
||||
test_case.add_expected_output<float>(Shape{1, 3, 2},
|
||||
{2.7327938, 2.1428573, 21.070545, 16.92727, 49.765778, 41.444443});
|
||||
test_case.add_expected_output<float>(Shape{1, 3, 2},
|
||||
{0.40161943, 0.5274726, 16.80789, 14.025973, 59.98805, 50.518517});
|
||||
test_case.add_expected_output<float>(
|
||||
Shape{1, 3, 2, 5},
|
||||
{0.40161943, 2.7327938, 7.3076925, 10., 9., 0.5274726, 2.1428573, 4.714286, 6., 5.,
|
||||
16.80789, 21.070545, 20.185184, 13.851851, 6.333333, 14.025973, 16.92727, 15.799998, 10.799999, 5.,
|
||||
59.98805, 49.765778, 33.074867, 16.690908, 5.8, 50.518517, 41.444443, 27.444445, 14., 5.});
|
||||
test_case.run();
|
||||
}
|
||||
|
||||
NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_ND_mixed_vals_neg_axes) {
|
||||
// Negative indices for scan_input_axes and scan_output_axes attributes
|
||||
const auto function =
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/scan15_ND_mixed_neg_axes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{1, 3, 2}, {0, 0, 0, 0, 0, 0});
|
||||
test_case.add_input<float>(Shape{1, 3, 2}, {1, 1, 1, 1, 1, 1});
|
||||
std::vector<float> sequence_vals{0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2, 1.3, 1.4, 1.5,
|
||||
1.6, 1.7, 1.8, 1.9, 2., 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.};
|
||||
test_case.add_input<float>(Shape{1, 3, 5, 2}, sequence_vals); // multiply factor (reverse)
|
||||
test_case.add_input<float>(Shape{1, 5, 3, 2}, sequence_vals); // div factor
|
||||
|
||||
test_case.add_expected_output<float>(Shape{1, 3, 2},
|
||||
{2.7327938, 2.1428573, 21.070545, 16.92727, 49.765778, 41.444443});
|
||||
test_case.add_expected_output<float>(Shape{1, 3, 2},
|
||||
{0.40161943, 0.5274726, 16.80789, 14.025973, 59.98805, 50.518517});
|
||||
test_case.add_expected_output<float>(
|
||||
Shape{1, 3, 2, 5},
|
||||
{0.40161943, 2.7327938, 7.3076925, 10., 9., 0.5274726, 2.1428573, 4.714286, 6., 5.,
|
||||
16.80789, 21.070545, 20.185184, 13.851851, 6.333333, 14.025973, 16.92727, 15.799998, 10.799999, 5.,
|
||||
59.98805, 49.765778, 33.074867, 16.690908, 5.8, 50.518517, 41.444443, 27.444445, 14., 5.});
|
||||
test_case.run();
|
||||
}
|
||||
|
||||
NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_dyn_rank_vals) {
|
||||
const auto function =
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/scan15_dyn_rank.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{1, 3, 2}, {0, 0, 0, 0, 0, 0});
|
||||
test_case.add_input<float>(Shape{1, 3, 2}, {1, 1, 1, 1, 1, 1});
|
||||
std::vector<float> sequence_vals{0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2, 1.3, 1.4, 1.5,
|
||||
1.6, 1.7, 1.8, 1.9, 2., 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.};
|
||||
test_case.add_input<float>(Shape{1, 3, 5, 2}, sequence_vals); // multiply factor (reverse)
|
||||
test_case.add_input<float>(Shape{1, 5, 3, 2}, sequence_vals); // div factor
|
||||
|
||||
test_case.add_expected_output<float>(Shape{1, 3, 2},
|
||||
{2.7327938, 2.1428573, 21.070545, 16.92727, 49.765778, 41.444443});
|
||||
test_case.add_expected_output<float>(Shape{1, 3, 2},
|
||||
{0.40161943, 0.5274726, 16.80789, 14.025973, 59.98805, 50.518517});
|
||||
test_case.add_expected_output<float>(
|
||||
Shape{1, 3, 2, 5},
|
||||
{0.40161943, 2.7327938, 7.3076925, 10., 9., 0.5274726, 2.1428573, 4.714286, 6., 5.,
|
||||
16.80789, 21.070545, 20.185184, 13.851851, 6.333333, 14.025973, 16.92727, 15.799998, 10.799999, 5.,
|
||||
59.98805, 49.765778, 33.074867, 16.690908, 5.8, 50.518517, 41.444443, 27.444445, 14., 5.});
|
||||
test_case.run();
|
||||
}
|
||||
|
||||
NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_dyn_rank_vals_neg_axes) {
|
||||
// Negative indices for scan_input_axes and scan_output_axes attributes
|
||||
try {
|
||||
const auto function =
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/scan15_dyn_rank_neg_axes.onnx"));
|
||||
} catch (const ngraph::ngraph_error& e) {
|
||||
EXPECT_HAS_SUBSTRING(e.what(), std::string("Rank must be static in order to normalize negative axis"));
|
||||
} catch (...) {
|
||||
FAIL() << "Expected exception was not thrown.";
|
||||
}
|
||||
}
|
||||
|
||||
NGRAPH_TEST(${BACKEND_NAME}, onnx_scan15_ND_b4_input_rev_vals) {
|
||||
const auto function =
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/scan15_ND_b4_input_rev.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{4, 3, 2}, std::vector<float>(24, 0));
|
||||
test_case.add_input<float>(Shape{4, 3, 2}, std::vector<float>(24, 1));
|
||||
std::vector<float> sequence_vals{
|
||||
0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8,
|
||||
1.9, 2., 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3., 3.1, 3.2, 3.3, 3.4, 3.5, 3.6,
|
||||
3.7, 3.8, 3.9, 4., 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5., 5.1, 5.2, 5.3, 5.4,
|
||||
5.5, 5.6, 5.7, 5.8, 5.9, 6., 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7., 7.1, 7.2,
|
||||
7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8., 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.,
|
||||
9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10., 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8,
|
||||
10.9, 11., 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9, 12.};
|
||||
test_case.add_input<float>(Shape{4, 5, 3, 2}, sequence_vals); // multiply factor (reverse)
|
||||
test_case.add_input<float>(Shape{4, 5, 3, 2}, sequence_vals); // div factor
|
||||
|
||||
test_case.add_expected_output<float>(
|
||||
Shape{4, 3, 2},
|
||||
{61.210526, 33.2, 23.857145, 19.181818, 16.373913, 14.5, 6.8880844, 6.83,
|
||||
6.7754016, 6.7239814, 6.6754713, 6.6296296, 5.9686656, 5.953226, 5.9382715, 5.9237804,
|
||||
5.9097314, 5.896105, 5.652082, 5.645059, 5.638186, 5.6314588, 5.624872, 5.618421});
|
||||
test_case.add_expected_output<float>(
|
||||
Shape{4, 3, 2},
|
||||
{6.271278, 6.2461543, 6.2433867, 6.2545457, 6.2744985, 6.3, 6.9531364, 6.970527,
|
||||
6.987378, 7.003712, 7.019554, 7.034921, 7.30868, 7.3164845, 7.324116, 7.3315806,
|
||||
7.338885, 7.346032, 7.485426, 7.489783, 7.494067, 7.49828, 7.5024257, 7.506502});
|
||||
test_case.add_expected_output<float>(
|
||||
Shape{5, 4, 3, 2},
|
||||
{25., 13., 9., 7., 5.8, 5., 1.7741936, 1.75, 1.7272727, 1.7058823,
|
||||
1.6857144, 1.6666667, 1.3934426, 1.3870969, 1.3809522, 1.375, 1.3692307, 1.3636364, 1.2637362, 1.2608696,
|
||||
1.2580644, 1.2553192, 1.2526315, 1.25, 70.57143, 35., 23.333334, 17.6, 14.218181, 12.,
|
||||
3.6739323, 3.618421, 3.5664334, 3.5176468, 3.471777, 3.4285717, 2.822119, 2.8083491, 2.7950313, 2.7821426,
|
||||
2.7696643, 2.757576, 2.543786, 2.5377107, 2.5317693, 2.5259573, 2.520271, 2.514706, 95.57143, 47.999996,
|
||||
32.333336, 24.6, 20.01818, 17., 5.448126, 5.368421, 5.293706, 5.223529, 5.157491, 5.0952387,
|
||||
4.215562, 4.195446, 4.1759834, 4.1571426, 4.138895, 4.1212125, 3.8075223, 3.7985802, 3.7898335, 3.7812767,
|
||||
3.7729027, 3.764706, 61.210526, 33.2, 23.857145, 19.181818, 16.373913, 14.5, 6.8880844, 6.83,
|
||||
6.7754016, 6.7239814, 6.6754713, 6.6296296, 5.9686656, 5.953226, 5.9382715, 5.9237804, 5.9097314, 5.896105,
|
||||
5.652082, 5.645059, 5.638186, 5.6314588, 5.624872, 5.618421, 6.271278, 6.2461543, 6.2433867, 6.2545457,
|
||||
6.2744985, 6.3, 6.9531364, 6.970527, 6.987378, 7.003712, 7.019554, 7.034921, 7.30868, 7.3164845,
|
||||
7.324116, 7.3315806, 7.338885, 7.346032, 7.485426, 7.489783, 7.494067, 7.49828, 7.5024257, 7.506502});
|
||||
test_case.run();
|
||||
}
|
||||
|
||||
NGRAPH_TEST(${BACKEND_NAME}, onnx_scan8_ND_b4_ones) {
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/scan8_ND_b4.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{4, 3, 2}, std::vector<float>(24, 0));
|
||||
test_case.add_input<float>(Shape{4, 3, 2}, std::vector<float>(24, 1));
|
||||
std::vector<float> sequence_vals(120, 1);
|
||||
test_case.add_input<float>(Shape{4, 5, 3, 2}, sequence_vals); // multiply by one
|
||||
test_case.add_input<float>(Shape{4, 5, 3, 2}, sequence_vals); // div by one
|
||||
|
||||
test_case.add_expected_output<float>(Shape{4, 3, 2}, {5., 5., 5., 5., 5., 5., 5., 5., 5., 5., 5., 5.,
|
||||
5., 5., 5., 5., 5., 5., 5., 5., 5., 5., 5., 5.});
|
||||
test_case.add_expected_output<float>(Shape{4, 3, 2}, {8., 8., 8., 8., 8., 8., 8., 8., 8., 8., 8., 8.,
|
||||
8., 8., 8., 8., 8., 8., 8., 8., 8., 8., 8., 8.});
|
||||
test_case.add_expected_output<float>(
|
||||
Shape{4, 5, 3, 2},
|
||||
{1., 1., 1., 1., 1., 1., 2., 2., 2., 2., 2., 2., 3., 3., 3., 3., 3., 3., 5., 5., 5., 5., 5., 5.,
|
||||
8., 8., 8., 8., 8., 8., 1., 1., 1., 1., 1., 1., 2., 2., 2., 2., 2., 2., 3., 3., 3., 3., 3., 3.,
|
||||
5., 5., 5., 5., 5., 5., 8., 8., 8., 8., 8., 8., 1., 1., 1., 1., 1., 1., 2., 2., 2., 2., 2., 2.,
|
||||
3., 3., 3., 3., 3., 3., 5., 5., 5., 5., 5., 5., 8., 8., 8., 8., 8., 8., 1., 1., 1., 1., 1., 1.,
|
||||
2., 2., 2., 2., 2., 2., 3., 3., 3., 3., 3., 3., 5., 5., 5., 5., 5., 5., 8., 8., 8., 8., 8., 8.});
|
||||
test_case.run();
|
||||
}
|
||||
|
||||
NGRAPH_TEST(${BACKEND_NAME}, onnx_scan8_ND_b4_input_rev_vals) {
|
||||
const auto function =
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/scan8_ND_b4_input_rev.onnx"));
|
||||
|
||||
auto test_case = test::TestCase(function, s_device);
|
||||
test_case.add_input<float>(Shape{4, 3, 2}, std::vector<float>(24, 0));
|
||||
test_case.add_input<float>(Shape{4, 3, 2}, std::vector<float>(24, 1));
|
||||
std::vector<float> sequence_vals{
|
||||
0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8,
|
||||
1.9, 2., 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3., 3.1, 3.2, 3.3, 3.4, 3.5, 3.6,
|
||||
3.7, 3.8, 3.9, 4., 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5., 5.1, 5.2, 5.3, 5.4,
|
||||
5.5, 5.6, 5.7, 5.8, 5.9, 6., 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7., 7.1, 7.2,
|
||||
7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8., 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.,
|
||||
9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10., 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8,
|
||||
10.9, 11., 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9, 12.};
|
||||
test_case.add_input<float>(Shape{4, 5, 3, 2}, sequence_vals); // multiply factor (reverse)
|
||||
test_case.add_input<float>(Shape{4, 5, 3, 2}, sequence_vals); // div factor
|
||||
|
||||
test_case.add_expected_output<float>(
|
||||
Shape{4, 3, 2},
|
||||
{61.210526, 33.2, 23.857145, 19.181818, 16.373913, 14.5, 6.8880844, 6.83,
|
||||
6.7754016, 6.7239814, 6.6754713, 6.6296296, 5.9686656, 5.953226, 5.9382715, 5.9237804,
|
||||
5.9097314, 5.896105, 5.652082, 5.645059, 5.638186, 5.6314588, 5.624872, 5.618421});
|
||||
test_case.add_expected_output<float>(
|
||||
Shape{4, 3, 2},
|
||||
{6.271278, 6.2461543, 6.2433867, 6.2545457, 6.2744985, 6.3, 6.9531364, 6.970527,
|
||||
6.987378, 7.003712, 7.019554, 7.034921, 7.30868, 7.3164845, 7.324116, 7.3315806,
|
||||
7.338885, 7.346032, 7.485426, 7.489783, 7.494067, 7.49828, 7.5024257, 7.506502});
|
||||
test_case.add_expected_output<float>(
|
||||
Shape{4, 5, 3, 2},
|
||||
{25., 13., 9., 7., 5.8, 5., 70.57143, 35., 23.333334, 17.6,
|
||||
14.218181, 12., 95.57143, 47.999996, 32.333336, 24.6, 20.01818, 17., 61.210526, 33.2,
|
||||
23.857145, 19.181818, 16.373913, 14.5, 6.271278, 6.2461543, 6.2433867, 6.2545457, 6.2744985, 6.3,
|
||||
1.7741936, 1.75, 1.7272727, 1.7058823, 1.6857144, 1.6666667, 3.6739323, 3.618421, 3.5664334, 3.5176468,
|
||||
3.471777, 3.4285717, 5.448126, 5.368421, 5.293706, 5.223529, 5.157491, 5.0952387, 6.8880844, 6.83,
|
||||
6.7754016, 6.7239814, 6.6754713, 6.6296296, 6.9531364, 6.970527, 6.987378, 7.003712, 7.019554, 7.034921,
|
||||
1.3934426, 1.3870969, 1.3809522, 1.375, 1.3692307, 1.3636364, 2.822119, 2.8083491, 2.7950313, 2.7821426,
|
||||
2.7696643, 2.757576, 4.215562, 4.195446, 4.1759834, 4.1571426, 4.138895, 4.1212125, 5.9686656, 5.953226,
|
||||
5.9382715, 5.9237804, 5.9097314, 5.896105, 7.30868, 7.3164845, 7.324116, 7.3315806, 7.338885, 7.346032,
|
||||
1.2637362, 1.2608696, 1.2580644, 1.2553192, 1.2526315, 1.25, 2.543786, 2.5377107, 2.5317693, 2.5259573,
|
||||
2.520271, 2.514706, 3.8075223, 3.7985802, 3.7898335, 3.7812767, 3.7729027, 3.764706, 5.652082, 5.645059,
|
||||
5.638186, 5.6314588, 5.624872, 5.618421, 7.485426, 7.489783, 7.494067, 7.49828, 7.5024257, 7.506502});
|
||||
test_case.run();
|
||||
}
|
||||
|
||||
NGRAPH_TEST(${BACKEND_NAME}, onnx_scan8_ND_b4_seq_lens) {
|
||||
// ONNX Scan-8 can has optional `sequence_lens` input, the input was removed since ONNX Scan-9
|
||||
try {
|
||||
const auto function =
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/scan8_ND_b4_seq_lens.onnx"));
|
||||
} catch (const ngraph::ngraph_error& e) {
|
||||
EXPECT_HAS_SUBSTRING(e.what(), std::string(" ONNX Scan-8 `sequence_lens` input is not supported. "));
|
||||
} catch (...) {
|
||||
FAIL() << "Expected exception was not thrown.";
|
||||
}
|
||||
}
|
||||
|
@ -1552,6 +1552,9 @@ onnx_model_embed_layer_normalization_dynamic_shapes
|
||||
# CPU plug-in doesn't support operation with dynamic rank
|
||||
onnx_model_attention_dynamic_shapes
|
||||
|
||||
# CPU plug-in doesn't support Parameter operation with dynamic rank
|
||||
IE_CPU.onnx_scan15_dyn_rank_vals
|
||||
|
||||
# z node not found in graph cache ticket: 81976
|
||||
IE_CPU.onnx_expand_context_dependent_function
|
||||
IE_CPU.onnx_softmax_crossentropy_loss_mean
|
||||
|
181
src/frontends/onnx/frontend/src/op/scan.cpp
Normal file
181
src/frontends/onnx/frontend/src/op/scan.cpp
Normal file
@ -0,0 +1,181 @@
|
||||
// Copyright (C) 2018-2022 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "op/scan.hpp"
|
||||
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
|
||||
#include "core/graph.hpp"
|
||||
#include "default_opset.hpp"
|
||||
#include "exceptions.hpp"
|
||||
#include "ngraph/function.hpp"
|
||||
#include "ngraph/log.hpp"
|
||||
#include "ngraph/op/util/op_types.hpp"
|
||||
#include "onnx_import/core/null_node.hpp"
|
||||
#include "openvino/core/validation_util.hpp"
|
||||
|
||||
namespace ngraph {
|
||||
namespace onnx_import {
|
||||
namespace op {
|
||||
|
||||
namespace {
|
||||
|
||||
OutputVector scan_to_tensor_iterator(const OutputVector& node_inputs,
|
||||
ParameterVector& body_inputs,
|
||||
OutputVector& body_outputs,
|
||||
int64_t num_scan_inputs,
|
||||
const std::vector<int64_t>& scan_input_axes,
|
||||
const std::vector<int64_t>& scan_input_directions,
|
||||
const std::vector<int64_t>& scan_output_axes,
|
||||
const std::vector<int64_t>& scan_output_directions,
|
||||
int64_t in_offset = 0,
|
||||
const std::string& node_description = "") {
|
||||
const size_t num_initial_values = body_inputs.size() - num_scan_inputs;
|
||||
const size_t num_scan_outputs = body_outputs.size() - num_initial_values;
|
||||
|
||||
// Body inputs alignment
|
||||
for (size_t i = 0; i < num_initial_values; ++i) {
|
||||
body_inputs[i]->set_element_type(node_inputs[i + in_offset].get_element_type());
|
||||
body_inputs[i]->set_partial_shape(node_inputs[i + in_offset].get_partial_shape());
|
||||
body_inputs[i]->validate_and_infer_types();
|
||||
}
|
||||
// Single slice of TensorIterator sliced input has the same rank as the input,
|
||||
// but in ONNX Scan the slice of input can has one dimension less,
|
||||
// so the parameter needs to have aligned rank with 1 at sliced axis,
|
||||
// and then squeezed to restore original shape.
|
||||
for (size_t i = 0; i < num_scan_inputs; ++i) {
|
||||
const auto in_idx = num_initial_values + i;
|
||||
auto axis = scan_input_axes[i];
|
||||
const auto axis_node = default_opset::Constant::create(element::i64, Shape{1}, {axis});
|
||||
auto shape = node_inputs[in_idx + in_offset].get_partial_shape();
|
||||
if (shape.rank().is_static()) {
|
||||
axis = ov::normalize_axis(node_description,
|
||||
scan_input_axes[i],
|
||||
node_inputs[in_idx + in_offset].get_partial_shape().rank());
|
||||
shape[axis] = 1;
|
||||
}
|
||||
body_inputs[in_idx]->set_partial_shape(shape);
|
||||
body_inputs[in_idx]->validate_and_infer_types();
|
||||
|
||||
auto input_consumers = body_inputs[in_idx]->output(0).get_target_inputs();
|
||||
auto squeeze = std::make_shared<default_opset::Squeeze>(body_inputs[in_idx], axis_node);
|
||||
for (auto& input : input_consumers) {
|
||||
input.replace_source_output(squeeze);
|
||||
}
|
||||
}
|
||||
// Body outputs shape alignment, add dimension along which scan outputs will be concatenated
|
||||
for (size_t i = 0; i < num_scan_outputs; ++i) {
|
||||
const auto out_idx = num_initial_values + i;
|
||||
const auto axis = scan_output_axes[i];
|
||||
const auto axis_node = default_opset::Constant::create(element::i64, Shape{1}, {axis});
|
||||
body_outputs[out_idx] = std::make_shared<default_opset::Unsqueeze>(body_outputs[out_idx], axis_node);
|
||||
}
|
||||
|
||||
// TensorIterator setup
|
||||
auto tensor_iterator = std::make_shared<default_opset::TensorIterator>();
|
||||
auto ti_body = std::make_shared<ov::Model>(body_outputs, body_inputs);
|
||||
tensor_iterator->set_function(ti_body);
|
||||
|
||||
// Set slicing for Scan (TensorIterator) inputs
|
||||
for (size_t i = 0; i < num_scan_inputs; ++i) {
|
||||
const auto in_idx = num_initial_values + i;
|
||||
const auto axis = ov::normalize_axis(node_description,
|
||||
scan_input_axes[i],
|
||||
node_inputs[in_idx + in_offset].get_partial_shape().rank());
|
||||
if (scan_input_directions[i]) { // reverse direction
|
||||
tensor_iterator->set_sliced_input(body_inputs[in_idx], node_inputs[in_idx + in_offset], -1, -1, 1, 0, axis);
|
||||
} else { // forward direction
|
||||
tensor_iterator->set_sliced_input(body_inputs[in_idx], node_inputs[in_idx + in_offset], 0, 1, 1, -1, axis);
|
||||
}
|
||||
}
|
||||
|
||||
// Set Scan (TensorIterator) outputs
|
||||
OutputVector outputs;
|
||||
for (size_t i = 0; i < num_initial_values; ++i) {
|
||||
// Back edge for state input/output
|
||||
tensor_iterator->set_merged_input(body_inputs[i], node_inputs[i + in_offset], body_outputs[i]);
|
||||
outputs.push_back(tensor_iterator->get_iter_value(body_outputs[i], -1));
|
||||
}
|
||||
for (size_t i = 0; i < num_scan_outputs; ++i) {
|
||||
const auto out_idx = num_initial_values + i;
|
||||
const auto axis =
|
||||
ov::normalize_axis(node_description, scan_output_axes[i], body_outputs[out_idx].get_partial_shape().rank());
|
||||
if (scan_output_directions[i]) { // reverse direction
|
||||
outputs.push_back(tensor_iterator->get_concatenated_slices(body_outputs[out_idx], -1, -1, 1, 0, axis));
|
||||
} else { // forward direction
|
||||
outputs.push_back(tensor_iterator->get_concatenated_slices(body_outputs[out_idx], 0, 1, 1, -1, axis));
|
||||
}
|
||||
}
|
||||
|
||||
return outputs;
|
||||
}
|
||||
|
||||
OutputVector import_onnx_scan(const Node& node,
|
||||
int64_t default_axis,
|
||||
int64_t in_offset,
|
||||
std::string&& in_directions_attr_name) {
|
||||
const auto& node_inputs = node.get_ng_inputs();
|
||||
|
||||
const auto& subgraphs = node.get_subgraphs();
|
||||
auto body_graph = subgraphs.at("body");
|
||||
auto body_outputs = body_graph->get_ng_outputs();
|
||||
auto body_inputs = body_graph->get_ng_parameters();
|
||||
|
||||
const int64_t num_scan_inputs = node.get_attribute_value<int64_t>("num_scan_inputs");
|
||||
const size_t num_initial_values = body_inputs.size() - num_scan_inputs;
|
||||
const size_t num_scan_outputs = body_outputs.size() - num_initial_values;
|
||||
|
||||
std::vector<int64_t> scan_input_axes =
|
||||
node.get_attribute_value<std::vector<int64_t>>("scan_input_axes",
|
||||
std::vector<int64_t>(num_scan_inputs, default_axis));
|
||||
std::vector<int64_t> scan_input_directions =
|
||||
node.get_attribute_value<std::vector<int64_t>>(in_directions_attr_name,
|
||||
std::vector<int64_t>(num_scan_inputs, 0));
|
||||
std::vector<int64_t> scan_output_axes =
|
||||
node.get_attribute_value<std::vector<int64_t>>("scan_output_axes",
|
||||
std::vector<int64_t>(num_scan_outputs, default_axis));
|
||||
std::vector<int64_t> scan_output_directions =
|
||||
node.get_attribute_value<std::vector<int64_t>>("scan_output_directions",
|
||||
std::vector<int64_t>(num_scan_outputs, 0));
|
||||
|
||||
return scan_to_tensor_iterator(node_inputs,
|
||||
body_inputs,
|
||||
body_outputs,
|
||||
num_scan_inputs,
|
||||
scan_input_axes,
|
||||
scan_input_directions,
|
||||
scan_output_axes,
|
||||
scan_output_directions,
|
||||
in_offset,
|
||||
node.get_description());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace set_1 {
|
||||
|
||||
OutputVector scan(const Node& node) {
|
||||
// ONNX Scan-8 can have optional `sequence_lens` input,
|
||||
// and sequence scan_input axis is assumed to be always 1.
|
||||
OPENVINO_ASSERT(ngraph::op::is_null(node.get_ng_inputs().at(0)),
|
||||
node.get_description(),
|
||||
" ONNX Scan-8 `sequence_lens` input is not supported. ");
|
||||
return import_onnx_scan(node, 1, 1, "directions");
|
||||
}
|
||||
|
||||
} // namespace set_1
|
||||
|
||||
namespace set_9 {
|
||||
|
||||
OutputVector scan(const Node& node) {
|
||||
// Since ONNX Scan-9 the optional `sequence_lens input` was removed,
|
||||
// new attributes to specify input/output axes and directions were added.
|
||||
return import_onnx_scan(node, 0, 0, "scan_input_directions");
|
||||
}
|
||||
|
||||
} // namespace set_9
|
||||
} // namespace op
|
||||
} // namespace onnx_import
|
||||
} // namespace ngraph
|
34
src/frontends/onnx/frontend/src/op/scan.hpp
Normal file
34
src/frontends/onnx/frontend/src/op/scan.hpp
Normal file
@ -0,0 +1,34 @@
|
||||
// Copyright (C) 2018-2022 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ngraph/node.hpp"
|
||||
#include "onnx_import/core/node.hpp"
|
||||
|
||||
namespace ngraph {
|
||||
namespace onnx_import {
|
||||
namespace op {
|
||||
namespace set_1 {
|
||||
/// \brief Creates OpenVino node representing ONNX Scan operator.
|
||||
///
|
||||
/// \note Details available here:
|
||||
/// https://github.com/onnx/onnx/blob/main/docs/Operators.md#Scan
|
||||
///
|
||||
/// \param[in] node The input ONNX node representing this operation.
|
||||
///
|
||||
/// \return OutputVector of resulting OpenVino nodes.
|
||||
///
|
||||
OutputVector scan(const Node& node);
|
||||
} // namespace set_1
|
||||
|
||||
namespace set_9 {
|
||||
OutputVector scan(const Node& node);
|
||||
} // namespace set_9
|
||||
|
||||
} // namespace op
|
||||
|
||||
} // namespace onnx_import
|
||||
|
||||
} // namespace ngraph
|
@ -133,6 +133,7 @@
|
||||
#include "op/rnn.hpp"
|
||||
#include "op/roi_align.hpp"
|
||||
#include "op/round.hpp"
|
||||
#include "op/scan.hpp"
|
||||
#include "op/scatter_elements.hpp"
|
||||
#include "op/scatter_nd.hpp"
|
||||
#include "op/selu.hpp"
|
||||
@ -420,6 +421,8 @@ void OperatorsBridge::_load_initial_state() {
|
||||
REGISTER_OPERATOR("RNN", 1, rnn);
|
||||
REGISTER_OPERATOR("RoiAlign", 1, roi_align);
|
||||
REGISTER_OPERATOR("Round", 1, round);
|
||||
REGISTER_OPERATOR("Scan", 1, scan);
|
||||
REGISTER_OPERATOR("Scan", 9, scan);
|
||||
REGISTER_OPERATOR("ScatterElements", 1, scatter_elements);
|
||||
REGISTER_OPERATOR("ScatterND", 1, scatter_nd);
|
||||
REGISTER_OPERATOR("Selu", 1, selu);
|
||||
|
Loading…
Reference in New Issue
Block a user