| 503 | } |
| 504 | |
| 505 | TfLiteStatus ArmnnSubgraph::Invoke(TfLiteContext* tfLiteContext, TfLiteNode* tfLiteNode) |
| 506 | { |
| 507 | // Prepare inputs |
| 508 | armnn::InputTensors inputTensors; |
| 509 | size_t inputIndex = 0; |
| 510 | for (auto inputIdx : tflite::TfLiteIntArrayView(tfLiteNode->inputs)) |
| 511 | { |
| 512 | TfLiteTensor* tensor = &tfLiteContext->tensors[inputIdx]; |
| 513 | if (tensor->allocation_type != kTfLiteMmapRo) |
| 514 | { |
| 515 | const armnn::BindingPointInfo& inputBinding = m_InputBindings[inputIndex]; |
| 516 | armnn::TensorInfo inputTensorInfo = inputBinding.second; |
| 517 | inputTensorInfo.SetConstant(true); |
| 518 | const armnn::ConstTensor inputTensor(inputTensorInfo, tensor->data.data); |
| 519 | inputTensors.emplace_back(inputIdx, inputTensor); |
| 520 | |
| 521 | ++inputIndex; |
| 522 | } |
| 523 | } |
| 524 | |
| 525 | // Prepare outputs |
| 526 | armnn::OutputTensors outputTensors; |
| 527 | size_t outputIndex = 0; |
| 528 | for (auto outputIdx : tflite::TfLiteIntArrayView(tfLiteNode->outputs)) |
| 529 | { |
| 530 | const armnn::BindingPointInfo& outputBinding = m_OutputBindings[outputIndex]; |
| 531 | TfLiteTensor* tensor = &tfLiteContext->tensors[outputIdx]; |
| 532 | const armnn::Tensor outputTensor(outputBinding.second, tensor->data.data); |
| 533 | outputTensors.emplace_back(outputIdx, outputTensor); |
| 534 | |
| 535 | ++outputIndex; |
| 536 | } |
| 537 | |
| 538 | // Run graph |
| 539 | auto status = m_Runtime->EnqueueWorkload(m_NetworkId, inputTensors, outputTensors); |
| 540 | return (status == armnn::Status::Success) ? kTfLiteOk : kTfLiteError; |
| 541 | } |
| 542 | |
| 543 | TfLiteStatus ArmnnSubgraph::VisitNode(DelegateData& delegateData, |
| 544 | TfLiteContext* tfLiteContext, |
no test coverage detected