code: def test_aten_test_serialization(self):
      model_path = (
          pytorch_test_dir
          + "/jit/fixtures/_test_serialization_subcmul_v2.pt"
      )
  
      # add test version entry to the version map
      upgrader_bumped_version = 3
      upgrader_name = "_test_serialization_subcmul_0_2"
      upgrader_schema = "aten::_test_serialization_subcmul(Tensor self, Tensor other, Scalar alpha=2) -> Tensor"
      dummy_entry = torch._C._UpgraderEntry(
          upgrader_bumped_version, upgrader_name, upgrader_schema
      )
  
      torch._C._test_only_add_entry_to_op_version_map(
          "aten::_test_serialization_subcmul", dummy_entry
      )
  
      # add test upgrader in the upgraders map
      @torch.jit.script
      def _test_serialization_subcmul_0_2(
          self: torch.Tensor,
          other: torch.Tensor,
          alpha: Union[int, float] = 2,
      ) -> torch.Tensor:
          return other - (self * alpha)
  
      torch._C._test_only_populate_upgraders(
          {
              "_test_serialization_subcmul_0_2": str(
                  _test_serialization_subcmul_0_2.graph
              )
          }
      )
  
      # test if the server is able to find the test upgraders and apply to IR
      loaded_model = torch.jit.load(model_path)
      FileCheck().check_count("aten::mul", 2).run(loaded_model.graph)
      FileCheck().check_count("aten::sub", 2).run(loaded_model.graph)
  
      buffer = io.BytesIO()
      torch.jit.save(loaded_model, buffer)
      buffer.seek(0)
      version = self._load_model_version(loaded_model)
      self.assertTrue(version == 3)
      loaded_model_twice = torch.jit.load(buffer)
      # we check by its' code because graph variable names
      # can be different every time
      self.assertEqual(loaded_model.code, loaded_model_twice.code)
      torch._C._test_only_remove_entry_to_op_version_map(
          "aten::_test_serialization_subcmul"
      )
      torch._C._test_only_remove_upgraders(
          {
              "_test_serialization_subcmul_0_2": str(
                  _test_serialization_subcmul_0_2.graph
              )
          }
      )
  
imports: import io
  import os
  import sys
  import torch
  import zipfile
  from torch.testing import FileCheck
  from typing import Union
  from torch.testing._internal.jit_utils import JitTestCase
label_desc: Use image node_id 11 for calling the TestUpgraders obj's underlying member method code with example usage: obj.test_aten_test_serialization() and returns: unknown