class_docstr: Tests for compatibility with TorchScript.
class_docstr_tok: ["Tests","for","compatibility","with","TorchScript","."]
docstr: Test to verify saving multiple ScriptModules with completely
  separate code works.
docstr_tok: ["Test","to","verify","saving","multiple","ScriptModules","with","completely","separate","code","works","."]
code: def test_save_independent_scriptmodules(self):
      """
      Test to verify saving multiple ScriptModules with completely
      separate code works.
      """
      from package_a.test_module import ModWithTensor, SimpleTest
  
      scripted_mod_0 = torch.jit.script(SimpleTest())
      scripted_mod_1 = torch.jit.script(
          ModWithTensor(torch.rand(1, 2, 3))
      )
  
      buffer = BytesIO()
      with PackageExporter(buffer) as e:
          e.save_pickle("res", "mod1.pkl", scripted_mod_0)
          e.save_pickle("res", "mod2.pkl", scripted_mod_1)
  
      buffer.seek(0)
      importer = PackageImporter(buffer)
      loaded_mod_0 = importer.load_pickle("res", "mod1.pkl")
      loaded_mod_1 = importer.load_pickle("res", "mod2.pkl")
      input = torch.rand(1, 2, 3)
      self.assertEqual(loaded_mod_0(input), scripted_mod_0(input))
      self.assertEqual(loaded_mod_1(input), scripted_mod_1(input))
  
imports: from io import BytesIO
  from textwrap import dedent
  from unittest import skipIf
  import torch
  from torch.package import PackageExporter, PackageImporter
  from torch.testing._internal.common_utils import IS_FBCODE, IS_SANDCASTLE, run_tests
label_desc: Use image node_id 10 for calling the TestPackageScript obj's underlying member method code with example usage: obj.test_save_independent_scriptmodules() without return types