tensorflow/lite/experimental/acceleration/mini_benchmark/call.cc
// Copy tensor data from subgraph's outputs to CALL node's outputs.
Copy tensor data from subgraph's outputs to CALL node's outputs.
Copy tensor data from subgraph ' s outputs to CALL node ' s outputs .
TfLiteStatus CopyOutputTensorsData(TfLiteContext* context,
                                   Subgraph* src_subgraph, TfLiteNode* node,
                                   int loop_index, int loop_count) {
  const std::vector<int>& src_tensor_indices = src_subgraph->outputs();
  TF_LITE_ENSURE_EQ(context, src_tensor_indices.size(), node->outputs->size);
  for (int i = 0; i < src_tensor_indices.size(); ++i) {
    const TfLiteTensor* src_tensor =
        src_subgraph->tensor(src_tensor_indices[i]);
    TfLiteTensor* dst_tensor = context->tensors + node->outputs->data[i];
    size_t offset = dst_tensor->bytes / loop_count * loop_index;
    TF_LITE_ENSURE_EQ(context, src_tensor->bytes,
                      dst_tensor->bytes / loop_count);
    memcpy(dst_tensor->data.raw + offset, src_tensor->data.raw,
           src_tensor->bytes);
  }
  return kTfLiteOk;
}
TfLiteStatus CopyOutputTensorsData ( TfLiteContext * context , Subgraph * src_subgraph , TfLiteNode * node , int loop_index , int loop_count ) { const std :: vector < int > & src_tensor_indices = src_subgraph -> outputs ( ) ; TF_LITE_ENSURE_EQ ( context , src_tensor_indices . size ( ) , node -> outputs -> size ) ; for ( int i = 0 ; i < src_tensor_indices . size ( ) ; ++ i ) { const TfLiteTensor * src_tensor = src_subgraph -> tensor ( src_tensor_indices [ i ] ) ; TfLiteTensor * dst_tensor = context -> tensors + node -> outputs -> data [ i ] ; size_t offset = dst_tensor -> bytes / loop_count * loop_index ; TF_LITE_ENSURE_EQ ( context , src_tensor -> bytes , dst_tensor -> bytes / loop_count ) ; memcpy ( dst_tensor -> data . raw + offset , src_tensor -> data . raw , src_tensor -> bytes ) ; } return kTfLiteOk ; }
Copy tensor data from subgraph's outputs to CALL node's outputs.
Copy tensor data from subgraph ' s outputs to CALL node ' s outputs .