| 5175 | } |
| 5176 | |
| 5177 | void TfLiteParserImpl::ParsePower(size_t subgraphIndex, size_t operatorIndex) |
| 5178 | { |
| 5179 | CHECK_MODEL(m_Model, subgraphIndex, operatorIndex); |
| 5180 | |
| 5181 | auto inputs = GetInputs(m_Model, subgraphIndex, operatorIndex); |
| 5182 | CHECK_VALID_SIZE(inputs.size(), 2); |
| 5183 | |
| 5184 | auto outputs = GetOutputs(m_Model, subgraphIndex, operatorIndex); |
| 5185 | CHECK_VALID_SIZE(outputs.size(), 1); |
| 5186 | |
| 5187 | auto layerName = fmt::format("Power:{}:{}", subgraphIndex, operatorIndex); |
| 5188 | |
| 5189 | TensorInfo inputTensorInfo = InputTensorInfo(subgraphIndex, operatorIndex, 0); |
| 5190 | TensorInfo input1TensorInfo = InputTensorInfo(subgraphIndex, operatorIndex, 1); |
| 5191 | CheckMatchingQuantization(inputTensorInfo, input1TensorInfo, layerName, "Input 0", "Input 1"); |
| 5192 | |
| 5193 | IConnectableLayer* layer = m_Network->AddElementwiseBinaryLayer(BinaryOperation::Power, layerName.c_str()); |
| 5194 | |
| 5195 | if (!layer) |
| 5196 | { |
| 5197 | throw NullPointerException(fmt::format("Layer {} pointer is null {}", |
| 5198 | operatorIndex, CHECK_LOCATION().AsString())); |
| 5199 | } |
| 5200 | |
| 5201 | TensorInfo outputTensorInfo = OutputTensorInfoFromInputs(subgraphIndex, operatorIndex, layer, 0, {0, 1}); |
| 5202 | CheckMatchingQuantization(inputTensorInfo, outputTensorInfo, layerName, "Input 0", "Output 0"); |
| 5203 | layer->GetOutputSlot(0).SetTensorInfo(outputTensorInfo); |
| 5204 | |
| 5205 | auto inputTensorIndexes = AsUnsignedVector(GetInputTensorIds(m_Model, subgraphIndex, operatorIndex)); |
| 5206 | RegisterInputSlots(subgraphIndex, operatorIndex, layer, {inputTensorIndexes[0], inputTensorIndexes[1]}); |
| 5207 | |
| 5208 | auto outputTensorIndexes = AsUnsignedVector(GetOutputTensorIds(m_Model, subgraphIndex, operatorIndex)); |
| 5209 | RegisterOutputSlots(subgraphIndex, operatorIndex, layer, {outputTensorIndexes[0]}); |
| 5210 | } |
| 5211 | |
| 5212 | void TfLiteParserImpl::ParseRsqrt(size_t subgraphIndex, size_t operatorIndex) |
| 5213 | { |
nothing calls this directly
no test coverage detected