[Common] Static analyzed issues. (#804)

This commit is contained in:
Nikolay Shchegolev authored and GitHub committed 2020-06-09 13:49:50 +03:00
1 parent b4546ad1e0
commit b6f2c06b26
10 files changed
+15 -17

No files matched your search

@@ -82,8 +82,6 @@ CNNNetwork::CNNNetwork(const std::shared_ptr<const ngraph::Function>& graph) {
}
// Copy nGraph function
if (graph == nullptr)
THROW_IE_EXCEPTION << "Cannot create CNNNetwork from empty nGraph function!";
network = std::make_shared<CNNNetworkNGraphImpl>(copyFunction(graph, false, {}));
actual = network.get();
if (actual == nullptr) {
@@ -1003,12 +1003,14 @@ void CNNNetworkInt8Normalizer::QuantizeConvolutionOrFullyConnected(CNNLayer::Ptr
symQuant = *(intervals.begin());
}
std::set<double> divs;
prev = 0.f;
for (auto it = individualsG.begin(); it != individualsG.end(); it++) {
if (prev) {
divs.insert((*it - prev) / symQuant);
if (symQuant != 0.) {
prev = 0.f;
for (auto it = individualsG.begin(); it != individualsG.end(); it++) {
if (prev) {
divs.insert((*it - prev) / symQuant);
}
prev = *it;
}
prev = *it;
}
bwquantized = true;
@@ -573,7 +573,7 @@ void MKLDNNNode::filterSupportedPrimitiveDescriptors() {
isSuitableDesc = false;
}
if (!isSuitableDesc) {
supportedPrimitiveDescriptors.erase(itpd);
itpd = supportedPrimitiveDescriptors.erase(itpd);
} else {
itpd++;
}
@@ -117,7 +117,6 @@ protected:
weightsData = inputs[PER_SAMPLE_WEIGHTS_IDX]->cbuffer().as<const T*>();
const auto& inDataDims = inputs[0]->getTensorDesc().getDims();
const size_t IN_BAGS_DEPTH = inDataDims.size() - 1;
const size_t OUTPUT_BAGS_NUM = outputs[0]->getTensorDesc().getDims()[0];
@@ -131,7 +131,6 @@ public:
const size_t BATCH = 0, CHANNEL = 1, HIGHT = 0, WIDTH = 1;
const int64_t IB = inDims[BATCH];
const int64_t IC = inDims[CHANNEL];
const int64_t IH = inDims[inDimsSize - 2];
const int64_t IW = inDims[inDimsSize - 1];
@@ -151,9 +150,6 @@ public:
const int64_t RH = _rates[HIGHT];
const int64_t RW = _rates[WIDTH];
int64_t ihStart = 0;
int64_t iwStart = 0;
int64_t iwStep = KW + (RW - 1) * (KW - 1);
int64_t ihStep = KH + (RH - 1) * (KH - 1);
@@ -190,7 +186,6 @@ public:
const int64_t OC_OH_OW = OC * OH_OW;
const int64_t IH_IW = IH * IW;
const int64_t IC_IH_IW = IC * IH_IW;
const int64_t KH_KW = KH * KW;
const int64_t work_amount = OB;
@@ -898,7 +898,7 @@ void MKLDNNConvolutionNode::filterSupportedDescriptors() {
isSuitableDesc = false;
}
if (!isSuitableDesc) {
descs.erase(itd);
itd = descs.erase(itd);
} else {
itd++;
}
@@ -55,7 +55,7 @@ INFERENCE_PLUGIN_API(StatusCode) InferenceEngine::CreateReader(IReader*& reader,
reader = new IRReader();
return OK;
}
catch (std::exception &ex) {
catch (std::exception &) {
return GENERAL_ERROR;
}
}
@@ -30,7 +30,7 @@ INFERENCE_PLUGIN_API(StatusCode) InferenceEngine::CreateReader(IReader*& reader,
reader = new ONNXReader();
return OK;
}
catch (std::exception &ex) {
catch (std::exception &) {
return GENERAL_ERROR;
}
}
@@ -22,6 +22,8 @@ void ngraph::pass::ConvertInterpolateToInterpOrResample::convert_interpolate_to_
ngraph::graph_rewrite_callback callback = [](pattern::Matcher& m) {
auto interpolate = std::dynamic_pointer_cast<ngraph::opset1::Interpolate> (m.get_match_root());
if (!interpolate)
return false;
auto data_node = interpolate->input_value(0);
auto out_shape_node = std::dynamic_pointer_cast<ngraph::opset1::Constant>(interpolate->input_value(1).get_node_shared_ptr());
@@ -47,6 +47,8 @@ void ngraph::pass::ConvertTileToIETile::convert_tile() {
//
// if (!already_set) return false;
auto last_node = std::dynamic_pointer_cast<ngraph::Node>(data_node);
if (!last_node)
return false;
auto friendly_name = tile->get_friendly_name();
int num_of_tile_dims = 0;