auto minputHolder = minput->wmap();
auto data = minputHolder.as<PrecisionTrait<Precision::U8>::value_type *>();
+ if (data == nullptr)
+ throw std::runtime_error("Input blob has not allocated buffer");
/** Iterate over all input images **/
for (size_t image_id = 0; image_id < imagesData.size(); ++image_id) {
/** Iterate over all pixel in image (b,g,r) **/
// --------------------------- 8. Process output -------------------------------------------------------
slog::info << "Processing output blobs" << slog::endl;
OutputsDataMap outputInfo(network.getOutputsInfo());
+ if (outputInfo.empty())
+ throw std::runtime_error("Can't get output blobs");
Blob::Ptr outputBlob = inferRequest.GetBlob(outputInfo.begin()->first);
/** Validating -nt value **/
size_t image_size = minput->getTensorDesc().getDims()[3] * minput->getTensorDesc().getDims()[2];
auto data = ilmHolder.as<PrecisionTrait<Precision::FP32>::value_type *>();
-
+ if (data == nullptr)
+ throw std::runtime_error("Input blob has not allocated buffer");
/** Iterate over all input images **/
for (size_t image_id = 0; image_id < imagesData.size(); ++image_id) {
/** Iterate over all pixel in image (b,g,r) **/
createConstInputTo(layer, shiftBlob, "biases");
} else if (scalesBlob != nullptr) {
Blob::Ptr biases = make_shared_blob<float>(scalesBlob->getTensorDesc());
+ if (biases == nullptr)
+ THROW_IE_EXCEPTION << "Cannot make 'biases' shared blob";
biases->allocate();
auto biasesPtr = biases->buffer().as<float*>();
for (size_t i = 0; i < biases->size(); i++)
inDesc.getPrecision()}));
MKLDNNNodePtr newReorder(new MKLDNNReorderNode(layer, getEngine(), weightsCache));
auto *reorderPtr = dynamic_cast<MKLDNNReorderNode *>(newReorder.get());
- if (reorderPtr) {
- reorderPtr->setDescs(inDesc, outDesc);
- reorderPtr->_scales = scales;
+ if (reorderPtr == nullptr) {
+ THROW_IE_EXCEPTION << "MKLDNNGraph::InsertReorder: Cannot cast to MKLDNNReorderNode";
}
+ reorderPtr->setDescs(inDesc, outDesc);
+ reorderPtr->_scales = scales;
auto oIndex = edge->getOutputNum();
auto iIndex = edge->getInputNum();
return false;
auto zeroPointsBlob = dynamic_cast<TBlob<uint8_t>*>(arg0->getCnnLayer()->blobs["custom"].get());
+ if (zeroPointsBlob == nullptr)
+ THROW_IE_EXCEPTION << "Cannot cast to TBlob internal zero points blob";
+
auto zeroPointsData = zeroPointsBlob->buffer().as<uint8_t*>();
+ if (zeroPointsData == nullptr)
+ THROW_IE_EXCEPTION << "zeroPointsBlob has not allocated buffer";
for (int j = 0; j < parent0->getParentEdgesAtPort(1)[0]->getDims()[1]; j++) {
convNode->inputZeroPoints.push_back(zeroPointsData[j]);
return false;
auto zeroPointsBlob = dynamic_cast<TBlob<int8_t>*>(arg0->getCnnLayer()->blobs["custom"].get());
+ if (zeroPointsBlob == nullptr)
+ THROW_IE_EXCEPTION << "Cannot cast to TBlob internal zero points blob";
+
auto zeroPointsData = zeroPointsBlob->buffer().as<int8_t*>();
+ if (zeroPointsData == nullptr)
+ THROW_IE_EXCEPTION << "zeroPointsBlob has not allocated buffer";
for (int j = 0; j < parent0->getParentEdgesAtPort(1)[0]->getDims()[0]; j++) {
convNode->weightsZeroPoints.push_back(static_cast<float>(zeroPointsData[j]));
weightsLayer = getCreatorLayer(weightsLayer->insData[0].lock()).lock();
}
+
auto weightsBlob = dynamic_cast<TBlob<int8_t>*>(weightsLayer->blobs["custom"].get());
+ if (weightsBlob == nullptr)
+ THROW_IE_EXCEPTION << "Cannot cast to TBlob internal weights blob";
+
auto weightsPtr = weightsBlob->buffer().as<int8_t*>();
+ if (weightsPtr == nullptr)
+ THROW_IE_EXCEPTION << "weightsBlob has not allocated buffer";
ptrdiff_t G = convLayer->_group;
ptrdiff_t OC = weightsLayer->outData[0]->getDims()[0] / G;
int batch_index;
int class_index;
int box_index;
- filteredBoxes() {}
+ filteredBoxes() = default;
filteredBoxes(float _score, int _batch_index, int _class_index, int _box_index) :
score(_score), batch_index(_batch_index), class_index(_class_index), box_index(_box_index) {}
};
THROW_IE_EXCEPTION << NOT_IMPLEMENTED_str;
} else {
auto cnnNetworkImpl = std::make_shared<details::CNNNetworkImpl>(network);
+ if (cnnNetworkImpl == nullptr)
+ THROW_IE_EXCEPTION << "Cannot create CNNNetworkImpl shared_ptr";
queryNetwork(*cnnNetworkImpl);
}
} else {