| 1257 | } |
| 1258 | |
| 1259 | void TfLiteParserImpl::ParseCast(size_t subgraphIndex, size_t operatorIndex) |
| 1260 | { |
| 1261 | CHECK_MODEL(m_Model, subgraphIndex, operatorIndex); |
| 1262 | |
| 1263 | auto inputs = GetInputs(m_Model, subgraphIndex, operatorIndex); |
| 1264 | CHECK_VALID_SIZE(inputs.size(), 1); |
| 1265 | auto outputs = GetOutputs(m_Model, subgraphIndex, operatorIndex); |
| 1266 | CHECK_VALID_SIZE(outputs.size(), 1); |
| 1267 | |
| 1268 | auto layerName = fmt::format("Cast:{}:{}", subgraphIndex, operatorIndex); |
| 1269 | |
| 1270 | IConnectableLayer* layer = m_Network->AddCastLayer(layerName.c_str()); |
| 1271 | |
| 1272 | if (!layer) |
| 1273 | { |
| 1274 | throw NullPointerException(fmt::format("Layer {} pointer is null {}", |
| 1275 | operatorIndex, CHECK_LOCATION().AsString())); |
| 1276 | } |
| 1277 | |
| 1278 | TensorInfo outputTensorInfo = OutputTensorInfoFromInputs(subgraphIndex, operatorIndex, layer, 0, {0}); |
| 1279 | layer->GetOutputSlot(0).SetTensorInfo(outputTensorInfo); |
| 1280 | |
| 1281 | auto inputTensorIndexes = AsUnsignedVector(GetInputTensorIds(m_Model, subgraphIndex, operatorIndex)); |
| 1282 | RegisterInputSlots(subgraphIndex, operatorIndex, layer, {inputTensorIndexes[0]}); |
| 1283 | |
| 1284 | auto outputTensorIndexes = AsUnsignedVector(GetOutputTensorIds(m_Model, subgraphIndex, operatorIndex)); |
| 1285 | RegisterOutputSlots(subgraphIndex, operatorIndex, layer, outputTensorIndexes); |
| 1286 | } |
| 1287 | |
| 1288 | void TfLiteParserImpl::ParseConv2D(size_t subgraphIndex, size_t operatorIndex) |
| 1289 | { |
nothing calls this directly
no test coverage detected