| 3227 | } |
| 3228 | |
| 3229 | void TfLiteParserImpl::ParseQuantize(size_t subgraphIndex, size_t operatorIndex) |
| 3230 | { |
| 3231 | CHECK_MODEL(m_Model, subgraphIndex, operatorIndex); |
| 3232 | |
| 3233 | auto inputs = GetInputs(m_Model, subgraphIndex, operatorIndex); |
| 3234 | CHECK_VALID_SIZE(inputs.size(), 1); |
| 3235 | |
| 3236 | auto outputs = GetOutputs(m_Model, subgraphIndex, operatorIndex); |
| 3237 | CHECK_VALID_SIZE(outputs.size(), 1); |
| 3238 | |
| 3239 | auto layerName = fmt::format("Quantize:{}:{}", subgraphIndex, operatorIndex); |
| 3240 | |
| 3241 | IConnectableLayer* layer = m_Network->AddQuantizeLayer(layerName.c_str()); |
| 3242 | |
| 3243 | if (!layer) |
| 3244 | { |
| 3245 | throw NullPointerException(fmt::format("Layer {} pointer is null {}", |
| 3246 | operatorIndex, CHECK_LOCATION().AsString())); |
| 3247 | } |
| 3248 | |
| 3249 | TensorInfo outputTensorInfo = OutputTensorInfoFromInputs(subgraphIndex, operatorIndex, layer, 0, {0}); |
| 3250 | layer->GetOutputSlot(0).SetTensorInfo(outputTensorInfo); |
| 3251 | |
| 3252 | auto inputTensorIndexes = AsUnsignedVector(GetInputTensorIds(m_Model, subgraphIndex, operatorIndex)); |
| 3253 | RegisterInputSlots(subgraphIndex, operatorIndex, layer, {inputTensorIndexes[0]}); |
| 3254 | |
| 3255 | auto outputTensorIndexes = AsUnsignedVector(GetOutputTensorIds(m_Model, subgraphIndex, operatorIndex)); |
| 3256 | RegisterOutputSlots(subgraphIndex, operatorIndex, layer, outputTensorIndexes); |
| 3257 | } |
| 3258 | |
| 3259 | void TfLiteParserImpl::ParseRelu(size_t subgraphIndex, size_t operatorIndex) |
| 3260 | { |
nothing calls this directly
no test coverage detected