code: def all_to_cuda(data, device=None):
      if isinstance(data, torch.Tensor):
          data = to_cuda(data, device)
      elif isinstance(data, (list, dict)):
          keys = (
              range(len(data))
              if isinstance(data, list)
              else data.keys()
          )
          for k in keys:
              if isinstance(data[k], torch.Tensor):
                  data[k] = to_cuda(data[k], device)
  
      return data
  
imports: import argparse
  import os
  import torch
  import torch.backends.cudnn
  import torch.multiprocessing
  import torch.optim
  from torch.utils.data import DataLoader
  from graph4nlp.pytorch.data.data import from_batch
  from graph4nlp.pytorch.modules.evaluation.accuracy import Accuracy
  from graph4nlp.pytorch.modules.graph_construction import NodeEmbeddingBasedRefinedGraphConstruction
  from graph4nlp.pytorch.modules.graph_construction.node_embedding_based_graph_construction import NodeEmbeddingBasedGraphConstruction
  from graph4nlp.pytorch.modules.utils.generic_utils import to_cuda
  from conll import ConllDataset
  from conlleval import evaluate
  from dependency_graph_construction_without_tokenize import DependencyBasedGraphConstruction_without_tokenizer
  from line_graph_construction import LineBasedGraphConstruction
  from model import Word2tag
label_desc: Use image node_id 1 for calling a global function with example usage: all_to_cuda(data, device) and returns: data