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 non_blocking_transfer(self, batch: Any) -> Any:
      if not self.device_helper.is_gpu:
          return batch
      if isinstance(batch, (list, tuple)):
          return [self.non_blocking_transfer(v) for v in batch]
      if isinstance(batch, dict):
          return {
              k: self.non_blocking_transfer(v) for k, v in batch.items()
          }
  
      batch = batch.pin_memory(self.device_helper.device)
      return batch.to(self.device_helper.device, non_blocking=True)
  
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 2 for calling the PrefetchLoader obj's underlying member method code with example usage: obj.non_blocking_transfer(batch) and returns: batch, batch, unknown, unknown