Removed const_cast from addOutput method (#3091)
authorIlya Churaev <ilya.churaev@intel.com>
Thu, 12 Nov 2020 11:59:28 +0000 (14:59 +0300)
committerGitHub <noreply@github.com>
Thu, 12 Nov 2020 11:59:28 +0000 (14:59 +0300)
inference-engine/src/inference_engine/cnn_network_ngraph_impl.cpp

index 5fba5a9..f9ddbe9 100644 (file)
@@ -224,9 +224,8 @@ StatusCode CNNNetworkNGraphImpl::addOutput(const std::string& layerName, size_t
     try {
         for (const auto & layer : _ngraph_function->get_ops()) {
             if (layer->get_friendly_name() == layerName) {
-                auto& results = const_cast<::ngraph::ResultVector&>(_ngraph_function->get_results());
                 auto result = make_shared<::ngraph::op::Result>(layer->output(outputIndex));
-                results.push_back(result);
+                _ngraph_function->add_results({result});
 
                 std::string outputName = layerName;
                 if (layer->outputs().size() != 1) {