[CPU] clone Constant node instead direct usage (#8719)

This commit is contained in:
Maxim Andronov 2021-11-21 14:50:17 +03:00 committed by GitHub
parent c4e49bb915
commit 7c525592e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1372,7 +1372,7 @@ void MKLDNNNode::createShapeInferSubgraph(const std::shared_ptr<ngraph::Node>& o
ngraph::OutputVector inputsForShapeInfer;
for (size_t i = 0; i < inputShapes.size(); i++) {
if (dynamic_cast<ngraph::opset1::Constant *>(op->get_input_node_ptr(i))) {
inputsForShapeInfer.push_back(op->get_input_node_shared_ptr(i));
inputsForShapeInfer.push_back(op->get_input_node_ptr(i)->clone_with_new_inputs(ngraph::OutputVector{}));
} else {
inputsForShapeInfer.push_back(std::make_shared<ngraph::opset1::Parameter>(op->get_input_element_type(i),
op->get_input_partial_shape(i)));