diff --git a/inference-engine/src/inference_engine/cpp_interfaces/interface/ie_iinfer_request_internal.cpp b/inference-engine/src/inference_engine/cpp_interfaces/interface/ie_iinfer_request_internal.cpp index a857a13f28c6d6..5f6f2982404755 100644 --- a/inference-engine/src/inference_engine/cpp_interfaces/interface/ie_iinfer_request_internal.cpp +++ b/inference-engine/src/inference_engine/cpp_interfaces/interface/ie_iinfer_request_internal.cpp @@ -206,16 +206,18 @@ bool IInferRequestInternal::findInputAndOutputBlobByName(const std::string& name [&](const std::pair& pair) { return pair.first == name; }); - if (foundOutputPair == std::end(_networkOutputs) && (foundInputPair == std::end(_networkInputs))) { - IE_THROW(NotFound) << "Failed to find input or output with name: \'" << name << "\'"; - } + bool retVal; + if (foundInputPair != std::end(_networkInputs)) { foundInput = foundInputPair->second; - return true; - } else { + retVal = true; + } else if (foundOutputPair != std::end(_networkOutputs)) { foundOutput = foundOutputPair->second; - return false; + retVal = false; + } else { + IE_THROW(NotFound) << "Failed to find input or output with name: \'" << name << "\'"; } + return retVal; } void IInferRequestInternal::checkBlob(const Blob::Ptr& blob, const std::string& name, bool isInput, const SizeVector& refDims) const { diff --git a/inference-engine/src/plugin_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp b/inference-engine/src/plugin_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp index b4f7feb612931e..f45bdc1e96042e 100644 --- a/inference-engine/src/plugin_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp +++ b/inference-engine/src/plugin_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp @@ -188,7 +188,6 @@ class INFERENCE_ENGINE_API_CLASS(IInferRequestInternal) : public std::enable_sha * @param foundOutput A pointer to output DataPtr if found. * @return `True` - if loaded network has input with provided name, * `false` - if loaded network has output with provided name - * @throws [parameter_mismatch] exception if input and output has the same name * @throws [not_found] exception if there is no input and output layers with given name */ bool findInputAndOutputBlobByName(const std::string& name, InputInfo::Ptr& foundInput, DataPtr& foundOutput) const;