code: def test_recursive_copy_to_gpu(self):
      tensor_a = get_mock_tensor()
      tensor_b = get_mock_tensor()
      tensor_structured = TestUtilMethods.StructuredInput(
          tensor_a=get_mock_tensor(), tensor_b=get_mock_tensor()
      )
  
      valid_gpu_copy_value = tensor_a
      gpu_value = util.recursive_copy_to_gpu(valid_gpu_copy_value)
      self.assertTrue(gpu_value.is_cuda)
  
      valid_recursive_copy_value = [[tensor_a]]
      gpu_value = util.recursive_copy_to_gpu(valid_recursive_copy_value)
      self.assertTrue(gpu_value[0][0].is_cuda)
  
      valid_gpu_copy_collections = [
          (tensor_a, tensor_b),
          [tensor_a, tensor_b],
          {"tensor_a": tensor_a, "tensor_b": tensor_b},
      ]
      for value in valid_gpu_copy_collections:
          gpu_value = util.recursive_copy_to_gpu(value)
          if isinstance(value, dict):
              self.assertTrue(gpu_value["tensor_a"].is_cuda)
              self.assertTrue(gpu_value["tensor_b"].is_cuda)
          else:
              self.assertEqual(len(gpu_value), 2)
              self.assertTrue(gpu_value[0].is_cuda)
              self.assertTrue(gpu_value[1].is_cuda)
  
      value = {"a": "b"}
      self.assertEqual(value, util.recursive_copy_to_gpu(value))
  
      valid_gpu_copy_structured = tensor_structured
      gpu_value = util.recursive_copy_to_gpu(valid_gpu_copy_structured)
      self.assertTrue(gpu_value.tensor_a.is_cuda)
      self.assertTrue(gpu_value.tensor_b.is_cuda)
  
imports: import copy
  import shutil
  import tempfile
  import unittest
  import unittest.mock
  from pathlib import Path
  import classy_vision.generic.util
  import torch
  import torch.nn
  from classy_vision.generic.util import CHECKPOINT_FILE, get_torch_version, load_checkpoint, save_checkpoint, split_batchnorm_params, Timer, update_classy_model, update_classy_state
  from classy_vision.models import build_model
  from classy_vision.tasks import build_task
  from classy_vision.trainer import LocalTrainer
  from test.generic.config_utils import get_fast_test_task_config, get_test_model_configs
  from test.generic.utils import compare_model_state, compare_states
label_desc: Use image node_id 1 for calling the TestUtilMethods obj's underlying member method code with example usage: obj.test_recursive_copy_to_gpu() without return types