diff --git a/inference-engine/src/plugin_api/cpp_interfaces/impl/ie_infer_request_internal.hpp b/inference-engine/src/plugin_api/cpp_interfaces/impl/ie_infer_request_internal.hpp index d15345a02d7dd9..9bb32e22b30f87 100644 --- a/inference-engine/src/plugin_api/cpp_interfaces/impl/ie_infer_request_internal.hpp +++ b/inference-engine/src/plugin_api/cpp_interfaces/impl/ie_infer_request_internal.hpp @@ -110,8 +110,8 @@ class InferRequestInternal : virtual public IInferRequestInternal { addInputPreProcessingFor(name, userBlob, devBlob ? devBlob : _inputs[name]); } else { size_t inputSize = foundInput->getTensorDesc().getLayout() != InferenceEngine::Layout::SCALAR - ? InferenceEngine::details::product(foundInput->getTensorDesc().getDims()) - : 1; + ? InferenceEngine::details::product(foundInput->getTensorDesc().getDims()) + : 1; if (dataSize != inputSize) { THROW_IE_EXCEPTION << "Input blob size is not equal network input size (" << dataSize << "!=" << inputSize << ")."; @@ -124,7 +124,9 @@ class InferRequestInternal : virtual public IInferRequestInternal { THROW_IE_EXCEPTION << NOT_IMPLEMENTED_str << "cannot set compound blob: supported only for input pre-processing"; } - size_t outputSize = details::product(foundOutput->getDims()); + size_t outputSize = foundOutput->getTensorDesc().getLayout() != InferenceEngine::Layout::SCALAR + ? details::product(foundOutput->getTensorDesc().getDims()) : + 1; if (dataSize != outputSize) { THROW_IE_EXCEPTION << "Output blob size is not equal network output size (" << dataSize << "!=" << outputSize << ").";