docstr: Tests that types between instances of a ScriptModule
  subclass that defines methods in its __init__ are not
  shared.
docstr_tok: ["Tests","that","types","between","instances","of","a","ScriptModule","subclass","that","defines","methods","in","its","__init__","are","not","shared","."]
code: def test_type_sharing_define_in_init(self):
      """
      Tests that types between instances of a ScriptModule
      subclass that defines methods in its __init__ are not
      shared.
      """
  
      class A(torch.jit.ScriptModule):
          def __init__(self, val):
              super().__init__()
              self.define(
                  f"""
                  def forward(self) -> int:
                      return {val}
                  """
              )
  
      one = A(1)
      two = A(2)
  
      self.assertEqual(one(), 1)
      self.assertEqual(two(), 2)
  
imports: import os
  import sys
  import io
  import torch
  from torch.testing._internal.jit_utils import JitTestCase
  from torch.testing._internal.common_utils import suppress_warnings
label_desc: Use image node_id 24 for calling the TestTypeSharing obj's underlying member method code with example usage: obj.test_type_sharing_define_in_init() without return types