| 2041 | } |
| 2042 | |
| 2043 | void 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 | |
| 2078 | void TfLiteParserImpl::ParseMinimum(size_t subgraphIndex, size_t operatorIndex) |
| 2079 | { |
nothing calls this directly
no test coverage detected