From c5d0dc3e5fc9fd35708ec90942c5077cf8da7399 Mon Sep 17 00:00:00 2001 From: Mateusz Tabaka Date: Mon, 15 Nov 2021 20:08:02 +0100 Subject: [PATCH] [GPU] fix constant shape if its user has scalar inputs (#8564) * [GPU] fix constant shape if its user has scalar inputs Currently for nodes like: ``` Multiply(input{}, mul_const{2}) -> mul{2} ``` cldnn sets 'mul_const' shape to (1, 2, 1, 1), which may not be correct if it's followed by ``` Add(mul{2}, add_const{2}) -> add{2} ``` because 'mul' shape is (1, 2, 1, 1), 'add_const' shape is (2, 1, 1, 1) and the result becomes (2, 2, 1, 1) instead of expected (2, 1, 1, 1) * Add tests for the issue --- inference-engine/src/cldnn_engine/ops/constant.cpp | 2 +- .../gpu/shared_tests_instances/single_layer_tests/eltwise.cpp | 1 + .../plugin/gpu/shared_tests_instances/skip_tests_config.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/inference-engine/src/cldnn_engine/ops/constant.cpp b/inference-engine/src/cldnn_engine/ops/constant.cpp index d2b4a37e63c..26e8c2845ee 100644 --- a/inference-engine/src/cldnn_engine/ops/constant.cpp +++ b/inference-engine/src/cldnn_engine/ops/constant.cpp @@ -103,7 +103,7 @@ static void CreateConstantOp(Program& p, const std::shared_ptrget_input_size(); j++) { auto& in_shape = outOp->get_input_shape(j); - if (in_shape.size() != 1) + if (in_shape.size() > 1) all_inputs_1d = false; } needsBatchInterpretation = all_inputs_1d; diff --git a/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/single_layer_tests/eltwise.cpp b/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/single_layer_tests/eltwise.cpp index df698303262..5c29a24c20b 100644 --- a/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/single_layer_tests/eltwise.cpp +++ b/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/single_layer_tests/eltwise.cpp @@ -11,6 +11,7 @@ using namespace ov::test::subgraph; namespace { std::vector> inShapes = { {{2}}, + {{}, {34100}}, {{2, 200}}, {{10, 200}}, {{1, 10, 100}}, diff --git a/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/skip_tests_config.cpp b/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/skip_tests_config.cpp index f7b4784aec8..9fb2778a7b7 100644 --- a/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/skip_tests_config.cpp +++ b/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/skip_tests_config.cpp @@ -88,7 +88,7 @@ std::vector disabledTestPatterns() { R"(.*CanSetOutBlobWithDifferentPrecision/netPRC=(I4|U4).*)", R"(.*CanSetOutBlobWithDifferentPrecision/netPRC=BIN.*)", // TODO: Issue: 67486 - R"(.*(EltwiseLayerTest|SoftMaxLayerTest).*)", + R"(.*(SoftMaxLayerTest).*)", // TODO: Issue: 68712 R"(.*.MatMul.*CompareWithRefs.*IS0=\(1.5\)_IS1=\(1.5\).*transpose_a=0.*transpose_b=1.*CONSTANT.*FP16.*UNSPECIFIED.*UNSPECIFIED.*ANY.*)", // TODO: Issue 66685