docstr: Test that a scripted class can have a method that refers to the class itself
  in its type annotations.
docstr_tok: ["Test","that","a","scripted","class","can","have","a","method","that","refers","to","the","class","itself","in","its","type","annotations","."]
code: def test_self_referential_method(self):
      """
      Test that a scripted class can have a method that refers to the class itself
      in its type annotations.
      """
  
      @torch.jit.script
      class Meta:
          def __init__(self, a: int):
              self.a = a
  
          def method(self, other: List["Meta"]) -> "Meta":
              return Meta(len(other))
  
      class ModuleWithMeta(torch.nn.Module):
          def __init__(self, a: int):
              super().__init__()
              self.meta = Meta(a)
  
          def forward(self):
              new_obj = self.meta.method([self.meta])
              return new_obj.a
  
      self.checkModule(ModuleWithMeta(5), ())
  
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 33 for calling the TestClassType obj's underlying member method code with example usage: obj.test_self_referential_method() and returns: Meta, new_obj