code: def assert_device_equal(
      self,
      fn,
      in_devices,
      expected_device,
      in_shapes=None,
      subtest_str="",
  ):
      with self.subTest(
          f"In device: {in_devices}, expected: {expected_device}, \n {subtest_str}"
      ):
          graph = torch.jit.script(fn).graph
          self.prop_device_on_graph(graph, in_devices, in_shapes)
          actual_device = self.node_output_device(graph)
  
          if expected_device is None or actual_device is None:
              self.assertEqual(actual_device, expected_device)
          else:
              self.assertEqual(
                  actual_device.type,
                  expected_device.type,
                  "Failed Verification",
              )
  
imports: from itertools import product
  import unittest
  import torch
  from torch.testing._internal.common_utils import TEST_CUDA
  from torch.testing._internal.jit_utils import JitTestCase
  from torch.jit._passes._property_propagation import apply_input_props_using_example
label_desc: Use image node_id 4 for calling the TestDeviceAnalysis obj's underlying member method code with example usage: obj.assert_device_equal(fn, in_devices, expected_device, in_shapes, subtest_str) without return types