onnxruntime/core/framework/utils.cc
// copies inputs across devices only if required using cached copy_info
copies inputs across devices only if required using cached copy_info
copies inputs across devices only if required using cached copy_info
static common::Status CachedCopyInputsAcrossDevices(const std::vector<MLValue>& orig_feeds,
                                                    std::vector<MLValue>& new_feeds,
                                                    const std::vector<FeedsFetchesManager::MLValueCopyInfo>& copy_info) {
  size_t num_feeds = orig_feeds.size();
  ORT_ENFORCE(copy_info.size() == num_feeds);
  new_feeds.resize(num_feeds);
  for (size_t idx = 0; idx < num_feeds; ++idx) {
    ORT_RETURN_IF_ERROR(CopyMLValue(copy_info[idx], orig_feeds[idx], new_feeds[idx]));
  }
  return Status::OK();
}
static common :: Status CachedCopyInputsAcrossDevices ( const std :: vector < MLValue > & orig_feeds , std :: vector < MLValue > & new_feeds , const std :: vector < FeedsFetchesManager :: MLValueCopyInfo > & copy_info ) { size_t num_feeds = orig_feeds . size ( ) ; ORT_ENFORCE ( copy_info . size ( ) == num_feeds ) ; new_feeds . resize ( num_feeds ) ; for ( size_t idx = 0 ; idx < num_feeds ; ++ idx ) { ORT_RETURN_IF_ERROR ( CopyMLValue ( copy_info [ idx ] , orig_feeds [ idx ] , new_feeds [ idx ] ) ) ; } return Status :: OK ( ) ; }
copies inputs across devices only if required using cached copy_info
copies inputs across devices only if required using cached copy_info