[CPU] Fix for MoveEltwiseUpThroughDataMov with dynamic shapes (#9036)

This commit is contained in:
Maxim Andronov
2021-12-07 09:31:33 +03:00
committed by GitHub
parent bba845037a
commit e68c459321

View File

@@ -85,7 +85,7 @@ MKLDNNPlugin::MoveEltwiseUpThroughDataMov::MoveEltwiseUpThroughDataMov() {
}
// eltwise constant shape should match new input shape
if (is_binary_op && current->get_output_shape(0).size() != eltwise->get_input_shape(1).size()) {
if (is_binary_op && current->get_output_partial_shape(0).rank().get_length() != eltwise->get_input_partial_shape(1).rank().get_length()) {
auto old_eltwise_const = std::dynamic_pointer_cast<ngraph::opset8::Constant>(eltwise->get_input_node_shared_ptr(1));
auto new_constant = std::make_shared<ngraph::opset8::Constant>(*old_eltwise_const.get(), ngraph::Shape{});
ngraph::replace_node(old_eltwise_const, new_constant);