MCPcopy Create free account
hub / github.com/ARM-software/armnn / ParseQuantize

Method ParseQuantize

src/armnnTfLiteParser/TfLiteParser.cpp:3229–3257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3227}
3228
3229void TfLiteParserImpl::ParseQuantize(size_t subgraphIndex, size_t operatorIndex)
3230{
3231 CHECK_MODEL(m_Model, subgraphIndex, operatorIndex);
3232
3233 auto inputs = GetInputs(m_Model, subgraphIndex, operatorIndex);
3234 CHECK_VALID_SIZE(inputs.size(), 1);
3235
3236 auto outputs = GetOutputs(m_Model, subgraphIndex, operatorIndex);
3237 CHECK_VALID_SIZE(outputs.size(), 1);
3238
3239 auto layerName = fmt::format("Quantize:{}:{}", subgraphIndex, operatorIndex);
3240
3241 IConnectableLayer* layer = m_Network->AddQuantizeLayer(layerName.c_str());
3242
3243 if (!layer)
3244 {
3245 throw NullPointerException(fmt::format("Layer {} pointer is null {}",
3246 operatorIndex, CHECK_LOCATION().AsString()));
3247 }
3248
3249 TensorInfo outputTensorInfo = OutputTensorInfoFromInputs(subgraphIndex, operatorIndex, layer, 0, {0});
3250 layer->GetOutputSlot(0).SetTensorInfo(outputTensorInfo);
3251
3252 auto inputTensorIndexes = AsUnsignedVector(GetInputTensorIds(m_Model, subgraphIndex, operatorIndex));
3253 RegisterInputSlots(subgraphIndex, operatorIndex, layer, {inputTensorIndexes[0]});
3254
3255 auto outputTensorIndexes = AsUnsignedVector(GetOutputTensorIds(m_Model, subgraphIndex, operatorIndex));
3256 RegisterOutputSlots(subgraphIndex, operatorIndex, layer, outputTensorIndexes);
3257}
3258
3259void TfLiteParserImpl::ParseRelu(size_t subgraphIndex, size_t operatorIndex)
3260{

Callers

nothing calls this directly

Calls 9

formatEnum · 0.85
AsUnsignedVectorFunction · 0.85
AddQuantizeLayerMethod · 0.80
GetOutputSlotMethod · 0.80
sizeMethod · 0.45
c_strMethod · 0.45
AsStringMethod · 0.45
SetTensorInfoMethod · 0.45

Tested by

no test coverage detected