class_docstr: A GPU prefetcher class for asynchronously transferring data of a
  :class:`torch.utils.data.DataLoader` from host memory to device memory.
  
  Args:
      loader (torch.utils.data.DataLoader): The data loader.
      device (torch.device, optional): The device to load the data to.
          (default: :obj:`None`)
class_docstr_tok: ["A","GPU","prefetcher","class","for","asynchronously","transferring","data","of","a",":","class",":","`","torch.utils.data.DataLoader","`","from","host","memory","to","device","memory",".","Args",":","loader","(","torch.utils.data.DataLoader",")",":","The","data","loader",".","device","(","torch.device",",","optional",")",":","The","device","to","load","the","data","to",".","(","default",":",":","obj",":","`","None","`",")"]
code: def __iter__(self) -> Any:
      first = True
      self.device_helper.maybe_init_stream()
  
      batch = None
      for next_batch in self.loader:
          with self.device_helper.stream_context():
              next_batch = self.non_blocking_transfer(next_batch)
  
          if not first:
              yield batch
          else:
              first = False
  
          self.device_helper.maybe_wait_stream()
  
          batch = next_batch
  
      yield batch
  
file_path: pytorch_geometric/torch_geometric/loader/prefetch.py
imports: import warnings
  from contextlib import nullcontext
  from functools import partial
  from typing import Any, Optional
  import torch
  from torch.utils.data import DataLoader
  from torch_geometric.typing import WITH_IPEX
label_desc: Use image node_id 3 for calling the PrefetchLoader obj's underlying member method code with example usage: obj.__iter__() without return types