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

Method ParseMaximum

src/armnnTfLiteParser/TfLiteParser.cpp:2043–2076  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2041}
2042
2043void TfLiteParserImpl::ParseMaximum(size_t subgraphIndex, size_t operatorIndex)
2044{
2045 CHECK_MODEL(m_Model, subgraphIndex, operatorIndex);
2046
2047 auto inputs = GetInputs(m_Model, subgraphIndex, operatorIndex);
2048 CHECK_VALID_SIZE(inputs.size(), 2);
2049
2050 auto outputs = GetOutputs(m_Model, subgraphIndex, operatorIndex);
2051 CHECK_VALID_SIZE(outputs.size(), 1);
2052
2053 auto layerName = fmt::format("Maximum:{}:{}", subgraphIndex, operatorIndex);
2054
2055 TensorInfo inputTensorInfo = InputTensorInfo(subgraphIndex, operatorIndex, 0);
2056 TensorInfo input1TensorInfo = InputTensorInfo(subgraphIndex, operatorIndex, 1);
2057 CheckMatchingQuantization(inputTensorInfo, input1TensorInfo, layerName, "Input 0", "Input 1");
2058
2059 IConnectableLayer* layer = m_Network->AddElementwiseBinaryLayer(BinaryOperation::Maximum, layerName.c_str());
2060
2061 if (!layer)
2062 {
2063 throw NullPointerException(fmt::format("Layer {} pointer is null {}",
2064 operatorIndex, CHECK_LOCATION().AsString()));
2065 }
2066
2067 TensorInfo outputTensorInfo = OutputTensorInfoFromInputs(subgraphIndex, operatorIndex, layer, 0, {0, 1});
2068 CheckMatchingQuantization(inputTensorInfo, outputTensorInfo, layerName, "Input 0", "Output 0");
2069 layer->GetOutputSlot(0).SetTensorInfo(outputTensorInfo);
2070
2071 auto inputTensorIndexes = AsUnsignedVector(GetInputTensorIds(m_Model, subgraphIndex, operatorIndex));
2072 RegisterInputSlots(subgraphIndex, operatorIndex, layer, {inputTensorIndexes[0], inputTensorIndexes[1]});
2073
2074 auto outputTensorIndexes = AsUnsignedVector(GetOutputTensorIds(m_Model, subgraphIndex, operatorIndex));
2075 RegisterOutputSlots(subgraphIndex, operatorIndex, layer, {outputTensorIndexes[0]});
2076}
2077
2078void TfLiteParserImpl::ParseMinimum(size_t subgraphIndex, size_t operatorIndex)
2079{

Callers

nothing calls this directly

Calls 10

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