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

Method ParseL2Normalization

src/armnnTfLiteParser/TfLiteParser.cpp:2007–2036  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2005}
2006
2007void TfLiteParserImpl::ParseL2Normalization(size_t subgraphIndex, size_t operatorIndex)
2008{
2009 CHECK_MODEL(m_Model, subgraphIndex, operatorIndex);
2010
2011 auto inputs = GetInputs(m_Model, subgraphIndex, operatorIndex);
2012 CHECK_VALID_SIZE(inputs.size(), 1);
2013
2014 auto outputs = GetOutputs(m_Model, subgraphIndex, operatorIndex);
2015 CHECK_VALID_SIZE(outputs.size(), 1);
2016
2017 L2NormalizationDescriptor desc;
2018 desc.m_DataLayout = armnn::DataLayout::NHWC;
2019 auto layerName = fmt::format("L2Normalization:{}:{}", subgraphIndex, operatorIndex);
2020 IConnectableLayer* layer = m_Network->AddL2NormalizationLayer(desc, layerName.c_str());
2021
2022 if (!layer)
2023 {
2024 throw NullPointerException(fmt::format("Layer {} pointer is null {}",
2025 operatorIndex, CHECK_LOCATION().AsString()));
2026 }
2027
2028 armnn::TensorInfo outputTensorInfo = OutputTensorInfoFromInputs(subgraphIndex, operatorIndex, layer, 0, {0});
2029 layer->GetOutputSlot(0).SetTensorInfo(outputTensorInfo);
2030
2031 auto inputTensorIndexes = AsUnsignedVector(GetInputTensorIds(m_Model, subgraphIndex, operatorIndex));
2032 RegisterInputSlots(subgraphIndex, operatorIndex, layer, {inputTensorIndexes[0]});
2033
2034 auto outputTensorIndexes = AsUnsignedVector(GetOutputTensorIds(m_Model, subgraphIndex, operatorIndex));
2035 RegisterOutputSlots(subgraphIndex, operatorIndex, layer, {outputTensorIndexes[0]});
2036}
2037
2038void TfLiteParserImpl::ParseMaxPool2D(size_t subgraphIndex, size_t operatorIndex)
2039{

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected