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 __next__(self) -> Any:
      # Make sure that future work in the main stream (training loop for instance)
      # waits for the dependent self.stream to be done
      torch.cuda.current_stream().wait_stream(self.stream)
  
      result = self.cache
      if self.cache is None:
          raise StopIteration
  
      # Pre-load the next sample
      self.preload()
  
      return result
  
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 4 for calling the DataloaderAsyncGPUWrapper obj's underlying member method code with example usage: obj.__next__() and returns: result