code: def _to_cuda_sequence(data: Sequence):
      """
      Move an object to CUDA.
  
      This function works recursively on lists and dicts, moving the values
      inside to cuda.
  
      Args:
          data (Sequence):
              The data you'd like to move to the GPU. If there's a pytorch tensor or
              model in data (e.g. in a list or as values in a dictionary) this
              function will move them all to CUDA and return something that matches
              the input in structure.
  
      Returns:
          Sequence, with the elements converted to cuda if possible
      """
      # use the type of this object to instantiate a new one:
      if hasattr(data, "_fields"):  # in case it's a named tuple
          return type(data)(*(to_cuda(item) for item in data))
      elif isinstance(data, str):
          # Special case
          return data
      else:
          return type(data)(to_cuda(item) for item in data)
  
imports: from collections.abc import Mapping, Sequence
  from functools import singledispatch
  import torch
label_desc: Use image node_id 4 for calling a global function with example usage: _to_cuda_sequence(data) and returns: type, data, type