class_docstr: Tests just-in-time cpp extensions.
  Don't confuse this with the PyTorch JIT (aka TorchScript).
code: def test_cpp_frontend_module_python_inter_op_with_cuda(self):
      extension = torch.utils.cpp_extension.load(
          name="cpp_frontend_extension",
          sources="cpp_extensions/cpp_frontend_extension.cpp",
          verbose=True,
      )
  
      net = extension.Net(5, 2)
      for p in net.parameters():
          self.assertTrue(p.device.type == "cpu")
      cpu_parameters = [p.clone() for p in net.parameters()]
  
      device = torch.device("cuda", 0)
      net.to(device)
  
      for i, p in enumerate(net.parameters()):
          self.assertTrue(p.device.type == "cuda")
          self.assertTrue(p.device.index == 0)
          self.assertEqual(cpu_parameters[i], p)
  
      net.cpu()
      net.add_new_parameter("a", torch.eye(5))
      net.add_new_parameter("b", torch.eye(5))
      net.add_new_buffer("c", torch.eye(5))
      net.add_new_buffer("d", torch.eye(5))
      net.add_new_submodule("fc2")
      net.add_new_submodule("fc3")
  
      for p in net.parameters():
          self.assertTrue(p.device.type == "cpu")
  
      net.cuda()
  
      for p in net.parameters():
          self.assertTrue(p.device.type == "cuda")
  
imports: import os
  import shutil
  import sys
  import unittest
  import warnings
  import re
  import tempfile
  import subprocess
  import glob
  import torch.testing._internal.common_utils
  from torch.testing._internal.common_cuda import TEST_CUDNN, TEST_CUDA
  import torch
  import torch.backends.cudnn
  import torch.utils.cpp_extension
  from torch.utils.cpp_extension import CUDA_HOME, ROCM_HOME
  from torch.testing._internal.common_utils import gradcheck
  import torch.multiprocessing
  from torch.utils.cpp_extension import _TORCH_PATH, remove_extension_h_precompiler_headers, get_cxx_compiler, check_compiler_is_gcc
label_desc: Use image node_id 23 for calling the TestCppExtensionJIT obj's underlying member method code with example usage: obj.test_cpp_frontend_module_python_inter_op_with_cuda() without return types