class_docstr: Tests just-in-time cpp extensions.
  Don't confuse this with the PyTorch JIT (aka TorchScript).
code: def test_autograd_from_cpp(self):
      source = """
          void run_back(at::Tensor x) {
              x.backward({});
          }
  
          void run_back_no_gil(at::Tensor x) {
              pybind11::gil_scoped_release no_gil;
              x.backward({});
          }
          """
  
      class MyFn(torch.autograd.Function):
          @staticmethod
          def forward(ctx, x):
              return x.clone()
  
          @staticmethod
          def backward(ctx, gx):
              return gx
  
      test_backward_deadlock = torch.utils.cpp_extension.load_inline(
          name="test_backward_deadlock",
          cpp_sources=[source],
          functions=["run_back", "run_back_no_gil"],
      )
  
      # This used to deadlock
      inp = torch.rand(20, requires_grad=True)
      loss = MyFn.apply(inp).sum()
      with self.assertRaisesRegex(
          RuntimeError,
          "The autograd engine was called while holding the GIL.",
      ):
          test_backward_deadlock.run_back(loss)
  
      inp = torch.rand(20, requires_grad=True)
      loss = MyFn.apply(inp).sum()
      test_backward_deadlock.run_back_no_gil(loss)
  
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 28 for calling the TestCppExtensionJIT obj's underlying member method code with example usage: obj.test_autograd_from_cpp() and returns: x, gx