class_docstr: Dataloader which wraps another dataloader, and moves the data to GPU asynchronously.
  At most one batch is pre-emptively copied (per worker).
  
  credits: @vini, nvidia Apex
class_docstr_tok: ["Dataloader","which","wraps","another","dataloader",",","and","moves","the","data","to","GPU","asynchronously",".","At","most","one","batch","is","pre-emptively","copied","(","per","worker",")",".","credits",":","@","vini",",","nvidia","Apex"]
code: def preload(self):
      # Get data from the iterator
      try:
          self.cache_next = next(self._iter)
  
          # Copy to the device, in a parallel CUDA stream
          with torch.cuda.stream(self.stream):
              self.cache = recursive_copy_to_gpu(
                  self.cache_next, non_blocking=True
              )
  
      except StopIteration:
          self.cache = None
          return
  
file_path: ClassyVision/classy_vision/dataset/dataloader_async_gpu_wrapper.py
imports: from typing import Any, Iterable, Iterator
  import torch
  from classy_vision.generic.util import recursive_copy_to_gpu
  from .dataloader_wrapper import DataloaderWrapper
label_desc: Use image node_id 3 for calling the DataloaderAsyncGPUWrapper obj's underlying member method code with example usage: obj.preload() without return types