From 12e08c40a91b1596c567d70fb251203f5ba75ce3 Mon Sep 17 00:00:00 2001 From: Szymon Gutaj Date: Thu, 23 Oct 2025 15:00:08 +0200 Subject: [PATCH 1/2] [ONNX FE] CVS-172238 Wrong shape of results produced by ConvTranspose - Adding test model from the original bug report --- .../models/conv_transpose_1x3x8x8.prototxt | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 src/frontends/onnx/tests/models/conv_transpose_1x3x8x8.prototxt diff --git a/src/frontends/onnx/tests/models/conv_transpose_1x3x8x8.prototxt b/src/frontends/onnx/tests/models/conv_transpose_1x3x8x8.prototxt new file mode 100644 index 00000000000000..27efe92ad9466e --- /dev/null +++ b/src/frontends/onnx/tests/models/conv_transpose_1x3x8x8.prototxt @@ -0,0 +1,117 @@ +ir_version: 8 +producer_name: "onnx-example" +graph { + node { + input: "input" + input: "weights" + input: "bias" + output: "output" + op_type: "ConvTranspose" + attribute { + name: "auto_pad" + s: "SAME_UPPER" + type: STRING + } + attribute { + name: "kernel_shape" + ints: 3 + ints: 3 + type: INTS + } + attribute { + name: "strides" + ints: 2 + ints: 2 + type: INTS + } + } + name: "complex_model" + initializer { + dims: 3 + dims: 1 + dims: 3 + dims: 3 + data_type: 1 + float_data: 0.84014213 + float_data: 1.7282453 + float_data: -0.3263198 + float_data: -0.48273504 + float_data: 0.25233305 + float_data: -0.40771398 + float_data: -1.2935431 + float_data: -0.36785364 + float_data: -1.2410039 + float_data: 0.8345059 + float_data: 0.24356616 + float_data: 1.004215 + float_data: -0.81657827 + float_data: -0.67410517 + float_data: 0.4060925 + float_data: 0.65320534 + float_data: -0.8198668 + float_data: -1.4369859 + float_data: -0.117572695 + float_data: -0.8670695 + float_data: 0.49399605 + float_data: -1.0330713 + float_data: -1.787455 + float_data: -0.30436283 + float_data: 0.06804885 + float_data: -0.950185 + float_data: 0.7083448 + name: "weights" + } + initializer { + dims: 1 + data_type: 1 + float_data: 1.3708473 + name: "bias" + } + input { + name: "input" + type { + tensor_type { + elem_type: 1 + shape { + dim { + dim_value: 1 + } + dim { + dim_value: 3 + } + dim { + dim_value: 8 + } + dim { + dim_value: 8 + } + } + } + } + } + output { + name: "output" + type { + tensor_type { + elem_type: 1 + shape { + dim { + dim_value: 1 + } + dim { + dim_value: 1 + } + dim { + dim_value: 16 + } + dim { + dim_value: 16 + } + } + } + } + } +} +opset_import { + version: 14 +} From 50f4a5ba4d92e81b79c42557b20b7944e3b25bb3 Mon Sep 17 00:00:00 2001 From: Szymon Gutaj Date: Thu, 23 Oct 2025 15:01:56 +0200 Subject: [PATCH 2/2] [ONNX FE] CVS-172238 Wrong shape of results produced by ConvTranspose - Adding a C++ test expecting behaviour coherent with onnxruntime --- src/frontends/onnx/tests/onnx_import.in.cpp | 73 +++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/src/frontends/onnx/tests/onnx_import.in.cpp b/src/frontends/onnx/tests/onnx_import.in.cpp index 7df87aac9fc732..5e722bf93e2af3 100644 --- a/src/frontends/onnx/tests/onnx_import.in.cpp +++ b/src/frontends/onnx/tests/onnx_import.in.cpp @@ -7199,3 +7199,76 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_split_to_sequence_explicit_split_1d) { test_case.run(); } + +OPENVINO_TEST(${BACKEND_NAME}, onnx_conv_transpose) { + const auto model = convert_model("conv_transpose_1x3x8x8.onnx"); + auto test_case = test::TestCase(model, s_device); + + test_case.add_input( + Shape{1, 3, 8, 8}, + {0.625151098f, 0.596945405f, 0.139096975f, 0.276130885f, 0.00713499123f, 0.0607993789f, 0.0772799626f, + 0.098484844f, 1.34567487f, 1.26065361f, 2.18789816f, 0.0653471872f, 1.77078462f, 1.35865974f, + 1.12412751f, 1.16306293f, 1.52882469f, 1.59743035f, 0.0923668891f, 1.24418771f, 0.447759897f, + 0.206789434f, 0.263984501f, 0.38207826f, 1.03937542f, 2.09021282f, 0.467289686f, 1.86369658f, + 1.23900259f, 0.384096682f, 0.296756178f, 2.11388206f, 1.25714934f, 0.192125842f, 0.486225724f, + 1.38173127f, 0.213047206f, 0.124264345f, 0.187946454f, 1.44937944f, 0.385222673f, 0.558024764f, + 1.00838554f, 0.124311149f, 1.90255845f, 1.11999547f, 0.974563539f, 0.582694709f, 0.531468391f, + 3.04861355f, 0.285169095f, 1.22178805f, 0.128970414f, 0.566250026f, 0.207558841f, 0.828584075f, + 0.89728272f, 0.458865613f, 0.844876111f, 1.37122619f, 1.16179717f, 0.920694292f, 1.14122105f, + 1.79164004f, 1.12682891f, 0.842717826f, 1.87564576f, 0.692874193f, 0.854609072f, 0.118006214f, + 1.14124298f, 1.92377281f, 0.0637631491f, 0.223139569f, 0.888881445f, 0.53058058f, 0.852253318f, + 1.32553041f, 0.644229054f, 0.412511975f, 0.000415288785f, 1.32483172f, 0.0566556714f, 0.104107559f, + 0.204130545f, 0.557883739f, 0.928778589f, 2.15578008f, 1.29505754f, 1.46797705f, 1.22587049f, + 0.174201131f, 0.917162478f, 0.479762316f, 0.0272906683f, 0.58244282f, 0.104637481f, 0.748023987f, + 0.389915824f, 0.398318321f, 0.0204038732f, 0.816221416f, 1.15234113f, 0.56337899f, 1.17305529f, + 0.882097483f, 0.985680401f, 1.11193633f, 0.781882703f, 0.922793448f, 1.66662455f, 0.944629848f, + 0.172961116f, 0.547528088f, 1.73304665f, 1.14912224f, 1.02735782f, 0.89158535f, 1.65481675f, + 0.572695494f, 1.31630123f, 0.0261730403f, 0.594345629f, 0.933356583f, 0.238472551f, 0.299513876f, + 0.158894345f, 0.197219521f, 1.52590966f, 1.35690475f, 0.141676888f, 2.15699768f, 1.94352877f, + 1.40682673f, 1.04016232f, 0.0508034416f, 0.224050492f, 2.41353512f, 0.352399886f, 1.54169703f, + 0.575035036f, 0.148580253f, 0.541164219f, 0.982789278f, 0.893933475f, 0.430977315f, 0.426253587f, + 1.35645676f, 1.1283102f, 1.80685508f, 1.7404393f, 0.435301125f, 0.270964503f, 1.02027822f, + 2.35678649f, 1.50359774f, 0.175944671f, 1.42923343f, 0.51326853f, 1.76939189f, 0.409514606f, + 0.098843053f, 1.47446668f, 1.30807877f, 0.258639991f, 0.16241923f, 1.01321244f, 0.661336064f, + 1.56858552f, 0.324210107f, 0.276222378f, 0.283114731f, 0.528313696f, 0.657391787f, 0.718641877f, + 0.193789124f, 0.694960773f, 1.91718662f, 0.33368668f, 1.39595342f, 1.22667146f, 2.16012883f, + 0.930284202f, 0.264723539f, 0.833213866f, 0.346019775f, 0.542626441f, 0.751732051f, 0.824235022f, + 0.240106314f, 0.243192792f, 1.26579654f}); + + test_case.add_expected_output( + Shape{1, 1, 16, 16}, + {2.6573596f, 1.4028443f, 4.0972548f, 1.4314597f, 4.3578296f, 1.9454411f, 3.8352995f, 0.14660478f, + 3.5325491f, -0.09385395f, 3.1708012f, 0.2849419f, 3.0595436f, 0.88058484f, 4.6874256f, 1.9657671f, + -1.4271703f, -1.9578989f, -1.2689271f, -1.4714081f, -0.6880493f, -0.11176324f, -0.89478993f, -2.8812065f, + -1.8260736f, -2.6766806f, -0.4557581f, -1.2072847f, -1.0778003f, -1.2378402f, -0.18433928f, 0.00793254f, + 2.5598915f, 0.91462886f, 0.625299f, -0.6883261f, 4.9794245f, 3.3402858f, -0.48474932f, -2.4428787f, + 5.647011f, 1.5908229f, 4.3976755f, 2.4576445f, 5.218449f, 1.0493553f, 3.2587147f, 0.9679994f, + 0.43803596f, 1.2673986f, -2.5041995f, -2.774383f, -1.9328954f, 0.69424534f, -1.3249359f, -1.7253704f, + -1.0541003f, 0.21577418f, -1.0713909f, 0.5547196f, -0.31757665f, 0.2533362f, -0.9039922f, -0.36981654f, + 0.86675096f, 2.4783175f, 0.78692436f, 1.1410911f, 0.06570482f, -0.6936395f, -0.79457116f, 0.446804f, + 0.7070204f, -0.6802912f, -1.4826708f, -1.4302483f, -0.93377686f, -0.9116616f, 2.039898f, 0.4790889f, + -0.29077184f, 0.15919542f, -1.8221278f, 0.11079192f, 0.595236f, 0.59444535f, -0.86034966f, -0.80915976f, + -1.0554218f, -0.66993546f, -1.4942114f, -2.1819417f, -1.7207026f, -2.2989116f, -1.2834756f, -0.7640624f, + 1.3762432f, 1.8358421f, 2.8903317f, 2.3734155f, 0.17097366f, -0.05188346f, 3.8043492f, 1.4990343f, + 2.3640583f, 2.179303f, 2.6996799f, -1.3378797f, 3.2507787f, -1.06673f, 4.1243954f, 1.3108639f, + -0.46783185f, 0.2759534f, -1.8708622f, -0.91447973f, -2.857119f, -3.5494027f, -1.6345084f, -0.9629924f, + -1.304385f, 0.75097924f, -0.86901784f, -1.4096525f, 0.27833247f, 0.51033777f, -2.2190294f, -1.6501224f, + 1.9863265f, 1.5128568f, -2.5925353f, -1.1423404f, -0.9549062f, -2.3884714f, 0.805175f, 0.4648738f, + -0.35856128f, 0.14508116f, -0.60080755f, -0.24887514f, 2.7460327f, 0.4786855f, 2.2991478f, 0.50355846f, + 0.255772f, 0.88604414f, -0.02920425f, 0.7385461f, -0.51006687f, -1.4041226f, -1.4613466f, -0.88637257f, + 0.18450892f, 0.94889903f, 0.3196156f, 0.5618108f, -0.47597563f, -1.1692247f, -0.38895023f, 0.17520154f, + 0.9588467f, 0.02494037f, 3.1908712f, 1.4914595f, 2.3549874f, 1.2150244f, 1.6093454f, -0.46660364f, + 3.1705766f, 4.0510902f, 3.7028868f, 2.092462f, 3.7487442f, 0.8617021f, 1.7030611f, 0.81675935f, + -1.3931973f, -2.1259043f, -0.11170983f, 0.33775055f, -0.17381096f, 0.46735197f, 0.01575041f, 0.14672112f, + -0.4168192f, 0.3799876f, -1.2211778f, -0.14325881f, -1.4845586f, -0.7910099f, 0.17895114f, 0.53488827f, + 2.2550125f, -0.8646877f, 3.3322372f, 3.8749132f, 1.1470155f, 0.55513835f, 3.1171486f, 1.325923f, + 0.17076433f, -1.062537f, 0.02016997f, -1.0994904f, 2.2208772f, -1.0816212f, 1.3488829f, 1.5402651f, + 0.25532985f, 0.14665699f, -2.8862572f, -1.6547394f, -2.1305242f, -0.32187414f, -1.1133051f, -1.5900698f, + -1.2538774f, -1.4813089f, -1.8708854f, -2.9475584f, -1.5677798f, -1.3548994f, 0.53412074f, 0.7209948f, + 2.598182f, 1.5223835f, -0.6943705f, -1.5216641f, 0.13439989f, 0.66287696f, 0.4604755f, 0.5986608f, + 1.7197694f, 0.6673063f, 1.863744f, -0.16457045f, 2.9755344f, 0.8545386f, 0.14387786f, 2.3924162f, + -0.9975097f, -0.7790427f, 0.68566245f, 0.8509063f, -0.36437345f, 0.21386564f, -1.0978005f, -0.25555706f, + -0.6449399f, 0.03057539f, -0.19369125f, 0.97245175f, 0.11240017f, 1.1174281f, -1.4373252f, -0.57256365f}); + + test_case.run_with_tolerance_as_fp(0.01f); +}