code: def to_device(
      inputs: Any, device: Optional[torch.device] = None
  ) -> Any:
      if hasattr(inputs, "to"):
          return inputs.to(device)
      elif isinstance(inputs, Mapping):
          return {
              key: to_device(value, device)
              for key, value in inputs.items()
          }
      elif isinstance(inputs, tuple) and hasattr(inputs, "_fields"):
          return type(inputs)(
              *(to_device(s, device) for s in zip(*inputs))
          )
      elif isinstance(inputs, Sequence) and not isinstance(inputs, str):
          return [to_device(s, device) for s in zip(*inputs)]
  
      return inputs
  
file_path: pytorch_geometric/torch_geometric/loader/cache.py
imports: from collections.abc import Mapping
  from typing import Any, Callable, List, Optional, Sequence
  import torch
  from torch.utils.data import DataLoader
label_desc: Use image node_id 1 for calling a global function with example usage: to_device(inputs, device) and returns: inputs, inputs, unknown, type, unknown