docstr: Exercise the situation where we have the same qualified name
  in two different CompilationUnits on save/load.
code: def test_different_functions(self):
      """
      Exercise the situation where we have the same qualified name
      in two different CompilationUnits on save/load.
      """
  
      def lol(x):
          return x
  
      class Foo(torch.nn.Module):
          def forward(self, x):
              return lol(x)
  
      first_script_module = torch.jit.script(Foo())
      first_saved_module = io.BytesIO()
      torch.jit.save(first_script_module, first_saved_module)
      first_saved_module.seek(0)
  
      clear_class_registry()
  
      def lol(x):  # noqa: F811
          return "hello"
  
      class Foo(torch.nn.Module):
          def forward(self, x):
              return lol(x)
  
      second_script_module = torch.jit.script(Foo())
      second_saved_module = io.BytesIO()
      torch.jit.save(torch.jit.script(Foo()), second_saved_module)
      second_saved_module.seek(0)
  
      clear_class_registry()
  
      self.assertEqual(
          first_script_module._c.qualified_name,
          second_script_module._c.qualified_name,
      )
  
      class ContainsBoth(torch.nn.Module):
          def __init__(self):
              super().__init__()
              self.add_module(
                  "second", torch.jit.load(second_saved_module)
              )
              self.add_module(
                  "first", torch.jit.load(first_saved_module)
              )
  
          def forward(self, x):
              x = self.first(x)
              x = self.second(x)
              return x
  
      sm = torch.jit.script(ContainsBoth())
      contains_both = io.BytesIO()
      torch.jit.save(sm, contains_both)
      contains_both.seek(0)
      sm = torch.jit.load(contains_both)
  
imports: import io
  import os
  import pathlib
  import sys
  from typing import NamedTuple, Optional
  import torch
  from torch import Tensor
  from torch.testing._internal.common_utils import TemporaryFileName
  from torch.testing._internal.jit_utils import JitTestCase, clear_class_registry
label_desc: Use image node_id 2 for calling the TestSaveLoad obj's underlying member method code with example usage: obj.test_different_functions() and returns: x, str, lol, lol, x