Skip to content

Commit

Permalink
[GNA] Fixed errors about unsupported 1d tensors
Browse files Browse the repository at this point in the history
  • Loading branch information
elilobanova committed May 18, 2021
1 parent 0face0e commit 77808aa
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 23 deletions.
7 changes: 1 addition & 6 deletions inference-engine/src/gna_plugin/frontend/layer_quantizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,7 @@ inline void quantizeWeightsBiases(const QuantDesc & quantDesc,
IE_THROW() << "Unsupported input scale factor value " << input_scale_factor;
}
}
if (wl->outData[0]->getDims().size() < 2) {
IE_THROW() << "Unsupported output dims size for " << wl->name <<", should be > 1, but " << wl->outData[0]->getDims().size();
}
if (wl->insData[0].lock().get()->getDims().size() < 2) {
IE_THROW() << "Unsupported input dims size for " << wl->name << ", should be > 1, but " << wl->insData[0].lock().get()->getDims().size();
}

uint32_t num_rows = isDiagonal ? 1 : wl->outData[0]->getDims()[oIdx];
uint32_t num_columns = isDiagonal ? wl->_weights->size() : wl->insData[0].lock().get()->getDims()[iIdx];

Expand Down
3 changes: 2 additions & 1 deletion inference-engine/src/gna_plugin/gna_graph_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,8 @@ void GNAGraphCompiler::EltwisePrimitive(InferenceEngine::CNNLayerPtr layer) {
auto in_2b_total_size = in_2b_batch * in_2b_channels * in_2b_height * in_2b_width;

if (in_2b_batch != in_4b_batch) {
THROW_GNA_LAYER_EXCEPTION(layer) << " Inputs with different batch sizes are not supported";
THROW_GNA_LAYER_EXCEPTION(layer) << " Inputs with different batch sizes " << in_2b_batch << " and "
<< in_4b_batch << " are not supported";
}

if (in_4b_total_size != in_2b_total_size) {
Expand Down
3 changes: 0 additions & 3 deletions inference-engine/src/gna_plugin/gna_graph_tools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -805,9 +805,6 @@ inline uint32_t GetDataDimSize(InferenceEngine::DataPtr data, DataDimName dimNam
std::vector<uint32_t> backOffsets;
switch (data->getLayout()) {
case Layout::C:
// 1 will be returned for offsets > 1
backOffsets = std::vector<uint32_t>{1, 2, 3, 4};
break;
case Layout::NC:
// 1 will be returned for offsets > 2
backOffsets = std::vector<uint32_t>{2, 1, 3, 4};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,6 @@ TEST_F(I8QuantisationTest, inputPrecisionIs16Bits){
ASSERT_EQ(inputLayer->precision, Precision::I16);
}

TEST_F(I8QuantisationTest, failIfFCDimensionIs1){
ModelQuantizer<QuantI8> q;

auto weights = make_shared_blob<uint8_t >({ Precision::U8, {440}, C });
weights->allocate();
fillWeights(weights);

Core ie;
auto network = ie.ReadNetwork(FCOnlyModel(), weights);

ASSERT_ANY_THROW(q.quantize(network, 1000));
}

TEST_F(I8QuantisationTest, outputAffinePrecisionIs32Bits){
ModelQuantizer<QuantI8> q;

Expand Down

0 comments on commit 77808aa

Please sign in to comment.