code: def test_py_class_to_ivalue_missing_attribute(self):
      class Foo:
          i: int
          f: float
  
          def __init__(self, i: int, f: float):
              self.i = i
              self.f = f
  
      make_global(Foo)  # see [local resolution in python]
  
      @torch.jit.script
      def test_fn(x: Foo) -> float:
          return x.i + x.f
  
      test_fn(Foo(3, 4.0))
  
      with self.assertRaisesRegexWithHighlight(
          RuntimeError, "missing attribute i", ""
      ):
          test_fn(torch.rand(3, 4))
  
imports: import io
  import os
  import sys
  import unittest
  import torch
  import torch.nn
  from torch.testing import FileCheck
  from typing import Any
  from torch.testing._internal.jit_utils import JitTestCase, make_global
  import torch.testing._internal.jit_utils
  from torch.testing._internal.common_utils import IS_SANDCASTLE, skipIfTorchDynamo
  from typing import List, Tuple, Iterable, Optional, Dict
label_desc: Use image node_id 31 for calling the TestClassType obj's underlying member method code with example usage: obj.test_py_class_to_ivalue_missing_attribute() and returns: unknown