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

Method ParseLogSoftmax

src/armnnTfLiteParser/TfLiteParser.cpp:2298–2323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2296}
2297
2298void TfLiteParserImpl::ParseLogSoftmax(size_t subgraphIndex, size_t operatorIndex)
2299{
2300 CHECK_MODEL(m_Model, subgraphIndex, operatorIndex);
2301
2302 LogSoftmaxDescriptor desc;
2303
2304 auto inputs = GetInputs(m_Model, subgraphIndex, operatorIndex);
2305 CHECK_VALID_SIZE(inputs.size(), 1);
2306 auto outputs = GetOutputs(m_Model, subgraphIndex, operatorIndex);
2307 CHECK_VALID_SIZE(outputs.size(), 1);
2308
2309 auto layerName = fmt::format("LogSoftmax:{}:{}", subgraphIndex, operatorIndex);
2310 IConnectableLayer* const layer = m_Network->AddLogSoftmaxLayer(desc, layerName.c_str());
2311
2312 armnn::TensorInfo outputTensorInfo = OutputTensorInfoFromInputs(subgraphIndex, operatorIndex, layer, 0, {0});
2313 layer->GetOutputSlot(0).SetTensorInfo(outputTensorInfo);
2314
2315 // register the input connection slots for the layer, connections are made after all layers have been created
2316 // only the tensors for the inputs are relevant, exclude the const tensors
2317 auto inputTensorIndexes = AsUnsignedVector(GetInputTensorIds(m_Model, subgraphIndex, operatorIndex));
2318 RegisterInputSlots(subgraphIndex, operatorIndex, layer, {inputTensorIndexes[0]});
2319
2320 // register the output connection slots for the layer, connections are made after all layers have been created
2321 auto outputTensorIndexes = AsUnsignedVector(GetOutputTensorIds(m_Model, subgraphIndex, operatorIndex));
2322 RegisterOutputSlots(subgraphIndex, operatorIndex, layer, {outputTensorIndexes[0]});
2323}
2324
2325void TfLiteParserImpl::ParseScatterNd(size_t subgraphIndex, size_t operatorIndex)
2326{

Callers

nothing calls this directly

Calls 7

formatEnum · 0.85
AsUnsignedVectorFunction · 0.85
AddLogSoftmaxLayerMethod · 0.80
GetOutputSlotMethod · 0.80
sizeMethod · 0.45
c_strMethod · 0.45
SetTensorInfoMethod · 0.45

Tested by

no test coverage detected