code: def copy_to_gpu(data, cuda_device: int, non_blocking: bool):
      if not pt.cuda.is_available():
          raise SystemError("GPU is not available!")
      if isinstance(data, pt.Tensor):
          return data.cuda(cuda_device, non_blocking=non_blocking)
      elif isinstance(data, container_abcs.Mapping):
          return {
              key: copy_to_gpu(val, cuda_device, non_blocking)
              for key, val in data.items()
          }
      elif isinstance(data, container_abcs.Sequence):
          return [
              copy_to_gpu(t, cuda_device, non_blocking) for t in data
          ]
      elif data is None:
          return None
      else:
          raise ValueError(
              f"expected tensor, sequence or dictionary of tensors, received {type(data).__name__}"
          )
  
file_path: gluonts/src/gluonts/nursery/daf/tslib/dataset/loader.py
imports: from typing import NamedTuple, Callable, Optional, Iterator
  import re
  from torch import Tensor
  from torch._six import container_abcs, int_classes, string_classes
  from torch.utils.data import Dataset, DataLoader, DistributedSampler
  import torch
  from ..engine.distributed import is_distributed, get_world_size
label_desc: Use image node_id 2 for calling a global function with example usage: copy_to_gpu(data, cuda_device, non_blocking) and returns: data, unknown, unknown, None