docstr: If submodules differ, the types should differ.
docstr_tok: ["If","submodules","differ",",","the","types","should","differ","."]
code: def test_submodules(self):
      """
      If submodules differ, the types should differ.
      """
  
      class M(torch.nn.Module):
          def __init__(self, in1, out1, in2, out2):
              super().__init__()
              self.submod1 = torch.nn.Linear(in1, out1)
              self.submod2 = torch.nn.Linear(in2, out2)
  
          def forward(self, x):
              x = self.submod1(x)
              x = self.submod2(x)
              return x
  
      a = M(1, 1, 2, 2)
      b = M(1, 1, 2, 2)
      self.assertSameType(a, b)
      self.assertSameType(a.submod1, b.submod1)
      c = M(2, 2, 2, 2)
      self.assertDifferentType(a, c)
  
      self.assertSameType(b.submod2, c.submod1)
      self.assertDifferentType(a.submod1, b.submod2)
  
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 7 for calling the TestTypeSharing obj's underlying member method code with example usage: obj.test_submodules() and returns: x