code: def _save_predict_factory(
      cls,
      pe: PackageExporter,
      predict_factory: Type[PredictFactory],
      configs: Dict[str, Any],
      loader_code: str = LOADER_CODE,
  ) -> None:
      # If predict_factory is coming from a torch package,
      # __module__ would have <torch_package_x> prefix.
      # To save such predict factory, we need to remove
      # the prefix.
      package_name = predict_factory.__module__
      if package_name.startswith("<torch_package_"):
          package_name = ".".join(package_name.split(".")[1:])
      # Save loader entry point.
      code = loader_code.replace("%PACKAGE%", package_name).replace(
          "%CLASS%", predict_factory.__name__
      )
      pe.save_source_string(module_name=LOADER_MODULE, src=code)
  
      # Save configs
      for name, config in configs.items():
          if isinstance(config, str):
              pe.save_text(CONFIG_MODULE, name, config)
          else:
              pe.save_pickle(CONFIG_MODULE, name, config)
  
      # Save predict factory.
      pe.save_module(predict_factory.__module__)
  
file_path: torchrec/torchrec/inference/model_packager.py
imports: import abc
  from pathlib import Path
  from typing import Any, BinaryIO, Dict, List, Type, TypeVar, Union
  import torch
  from torch.package import PackageExporter
  from torchrec.inference.modules import PredictFactory
label_desc: Use image node_id 4 for calling the PredictFactoryPackager obj's underlying member method code with example usage: obj._save_predict_factory(cls, pe, predict_factory, configs, loader_code) without return types