From b1ae35d2d5df4596d7ea70061b376fe829e6e514 Mon Sep 17 00:00:00 2001 From: Alexandra Sidorova Date: Wed, 26 Jan 2022 11:19:02 +0300 Subject: [PATCH] returned Reshape in condition --- .../common_optimizations/nop_elimination.cpp | 3 ++- .../common_optimizations/nop_elimination.cpp | 12 ++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/common/transformations/src/transformations/common_optimizations/nop_elimination.cpp b/src/common/transformations/src/transformations/common_optimizations/nop_elimination.cpp index cd0dc462f20f01..a9277430a8b852 100644 --- a/src/common/transformations/src/transformations/common_optimizations/nop_elimination.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/nop_elimination.cpp @@ -104,7 +104,8 @@ static bool eliminate_reshape_v1(const std::shared_ptr& node) { return false; if (ov::as_type_ptr(input_node) || - ov::as_type_ptr(input_node)) { + ov::as_type_ptr(input_node) || + ov::as_type_ptr(input_node)) { auto shape = node->get_output_shape(0); // remove interchangeable nodes diff --git a/src/tests/functional/inference_engine/transformations/common_optimizations/nop_elimination.cpp b/src/tests/functional/inference_engine/transformations/common_optimizations/nop_elimination.cpp index 4488d55e2d5e6d..a981e779e7a08e 100644 --- a/src/tests/functional/inference_engine/transformations/common_optimizations/nop_elimination.cpp +++ b/src/tests/functional/inference_engine/transformations/common_optimizations/nop_elimination.cpp @@ -140,17 +140,13 @@ TEST(nop_elimination, squeeze_reshape_elimination_check_info) { pass_manager.register_pass(); pass_manager.run_passes(f); - bool reshape_is_missing = true; + bool movement_are_missing = true; for (auto node : f->get_ops()) { - if (node->get_friendly_name() == "reshape") { - reshape_is_missing = false; - ASSERT_TRUE(std::dynamic_pointer_cast(node)); - auto original_names = ngraph::getFusedNamesVector(node); - sort(original_names.begin(), original_names.end()); - ASSERT_EQ(original_names, std::vector({"reshape", "squeeze"})); + if (node->get_friendly_name() == "reshape" || node->get_friendly_name() == "squeeze") { + movement_are_missing = false; } } - ASSERT_FALSE(reshape_is_missing); + ASSERT_TRUE(movement_are_missing); } TEST(nop_elimination, squeeze_unsqueeze_elimination) {