[CPU] Broadcast check has been added to the ConvertPowerToPowerIEMatcher transformati...
authorMaksim Kutakov <maksim.kutakov@intel.com>
Mon, 16 Nov 2020 12:58:10 +0000 (15:58 +0300)
committerGitHub <noreply@github.com>
Mon, 16 Nov 2020 12:58:10 +0000 (15:58 +0300)
* [CPU] Added broadcast check to the ConvertPowerToPowerIE transformation.

* [CPU] Eltwise single layer test instance extended with a two inputs case.

inference-engine/src/legacy_api/src/transformations/convert_opset1_to_legacy/convert_power_to_power_ie.cpp
inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/eltwise.cpp

index 14f6aa3..67471fa 100644 (file)
@@ -33,6 +33,11 @@ ngraph::pass::ConvertPowerToPowerIEMatcher::ConvertPowerToPowerIEMatcher() {
                 return false;
             }
 
+            //check broadcast influence
+            if (ngraph::op::util::check_for_broadcast(power->input(0).get_shape(), node->get_shape())) {
+                return false;
+            }
+
             auto power_ie = std::make_shared<ngraph::op::PowerIE>(power->input(0).get_source_output(), value, 1.0f, 0.0f, power->output(0).get_element_type());
             power_ie->set_friendly_name(power->get_friendly_name());
             ngraph::copy_runtime_info(power, power_ie);
@@ -44,4 +49,4 @@ ngraph::pass::ConvertPowerToPowerIEMatcher::ConvertPowerToPowerIEMatcher() {
 
     auto m = std::make_shared<ngraph::pattern::Matcher>(power, "ConvertPowerToPowerIE");
     this->register_matcher(m, callback);
-}
+}
\ No newline at end of file
index 75ada84..66863b9 100644 (file)
@@ -16,6 +16,8 @@ std::vector<std::vector<std::vector<size_t>>> inShapes = {
         {{1, 10, 100}},
         {{4, 4, 16}},
         {{1, 1, 1, 3}},
+        {{2, 17, 5, 4}, {1, 17, 1, 1}},
+        {{2, 17, 5, 1}, {1, 17, 1, 4}},
         {{1, 2, 4}},
         {{1, 4, 4}},
         {{1, 4, 4, 1}},