Skip to content

Commit ae9e051

Browse files
authored
[GNA] Additional checks (#998)
1 parent 76af547 commit ae9e051

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

inference-engine/src/gna_plugin/backend/am_intel_dnn.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,6 +1584,7 @@ void GNAPluginNS::backend::AMIntelDNN::InitGNAStruct(intel_nnet_type_t *ptr_nnet
15841584
case kDnnPiecewiselinearOp:
15851585
#if GNA_LIB_VER == 2
15861586
{
1587+
IE_ASSERT(gnaOperation->Operands != nullptr);
15871588
auto& outputTensor = const_cast<Gna2Tensor&>(*gnaOperation->Operands[OutOpIdx]);
15881589
outputTensor.Data = comp.ptr_outputs;
15891590
outputTensor.Type = Gna2DataTypeFromBytes(comp.num_bytes_per_output);

inference-engine/src/gna_plugin/gna_graph_compiler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ void GNAGraphCompiler::ConvolutionPrimitive(InferenceEngine::CNNLayerPtr layer)
337337
void GNAGraphCompiler::PowerPrimitive(InferenceEngine::CNNLayerPtr layer) {
338338
auto& power = dynamic_cast<PowerLayer&>(*layer.get());
339339
auto quantized = InferenceEngine::getInjectedData<QuantizedLayerParams>(layer);
340+
IE_ASSERT(gnaFlags->sw_fp32 ? (quantized == nullptr) : (quantized != nullptr));
340341

341342
if (power.power != 1.0) {
342343
THROW_IE_EXCEPTION << "[GNA plugin] unsupported power factor, expected 1 but was " << power.power;

inference-engine/src/gna_plugin/gna_model_serial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ void GNAModelSerial::Import(void *basePointer, size_t gnaGraphSize, std::istream
161161
for (uint32_t i = 0; i < operation->NumberOfParameters; i++) {
162162
uint32_t paramSize;
163163
readBits(paramSize, is);
164+
IE_ASSERT(operation->Parameters != nullptr);
164165
if (paramSize == 0) {
165-
IE_ASSERT(operation->Parameters != nullptr);
166166
operation->Parameters[i] = nullptr;
167167
continue;
168168
}

0 commit comments

Comments
 (0)