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

Method ParseCast

src/armnnTfLiteParser/TfLiteParser.cpp:1259–1286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1257}
1258
1259void 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
1288void TfLiteParserImpl::ParseConv2D(size_t subgraphIndex, size_t operatorIndex)
1289{

Callers

nothing calls this directly

Calls 9

formatEnum · 0.85
AsUnsignedVectorFunction · 0.85
AddCastLayerMethod · 0.80
GetOutputSlotMethod · 0.80
sizeMethod · 0.45
c_strMethod · 0.45
AsStringMethod · 0.45
SetTensorInfoMethod · 0.45

Tested by

no test coverage detected