class_docstr: Tests for compatibility with FX.
class_docstr_tok: ["Tests","for","compatibility","with","FX","."]
code: def test_package_then_fx(self):
      from package_a.test_module import SimpleTest
  
      model = SimpleTest()
      f = BytesIO()
      with PackageExporter(f) as pe:
          pe.intern("**")
          pe.save_pickle("model", "model.pkl", model)
  
      f.seek(0)
      pi = PackageImporter(f)
      loaded = pi.load_pickle("model", "model.pkl")
      traced = symbolic_trace(loaded)
      input = torch.rand(2, 3)
      self.assertEqual(loaded(input), traced(input))
  
file_path: pytorch/test/package/test_package_fx.py
imports: from io import BytesIO
  import torch
  from torch.fx import Graph, GraphModule, symbolic_trace
  from torch.package import ObjMismatchError, PackageExporter, PackageImporter, sys_importer
  from torch.testing._internal.common_utils import run_tests
label_desc: Use image node_id 2 for calling the TestPackageFX obj's underlying member method code with example usage: obj.test_package_then_fx() without return types