docstr: Test that type sharing can be disabled.
docstr_tok: ["Test","that","type","sharing","can","be","disabled","."]
code: def test_type_sharing_disabled(self):
      """
      Test that type sharing can be disabled.
      """
  
      class A(torch.nn.Module):
          def __init__(self, sub):
              super().__init__()
              self.sub = sub
  
          def forward(self, x):
              return x
  
      class B(torch.nn.Module):
          def forward(self, x):
              return x
  
      top1 = A(A(B()))
      top2 = A(A(B()))
  
      top1_s = torch.jit._recursive.create_script_module(
          top1,
          torch.jit._recursive.infer_methods_to_compile,
          share_types=False,
      )
      top2_s = torch.jit._recursive.create_script_module(
          top2,
          torch.jit._recursive.infer_methods_to_compile,
          share_types=False,
      )
  
      self.assertDifferentType(top1_s, top2_s)
      self.assertDifferentType(top1_s, top1_s.sub)
      self.assertDifferentType(top1_s, top2_s.sub)
      self.assertDifferentType(top2_s, top2_s.sub)
      self.assertDifferentType(top2_s, top1_s.sub)
  
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 25 for calling the TestTypeSharing obj's underlying member method code with example usage: obj.test_type_sharing_disabled() and returns: x, x