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