class_docstr: A base classification model that scores a pair of texts.
  
  Subclasses need to implement the from_config, forward and save_modules.
class_docstr_tok: ["A","base","classification","model","that","scores","a","pair","of","texts",".","Subclasses","need","to","implement","the","from_config",",","forward","and","save_modules","."]
code: def _save_modules(
      self, modules: Dict[str, nn.Module], base_path: str, suffix: str
  ):
      super().save_modules(base_path, suffix)
      # Special case to also save the multi-representations separately, if needed.
      for key, module in modules.items():
          if getattr(module.config, "save_path", None):
              path = f"{module.config.save_path}-{key}{suffix}"
              if base_path:
                  path = os.path.join(base_path, path)
              print(
                  f"Saving state of module {type(module).__name__} "
                  f"to {path} ..."
              )
              with PathManager.open(path, "wb") as save_file:
                  if isinstance(module, torch.jit.ScriptModule):
                      module.save(save_file)
                  else:
                      torch.save(module.state_dict(), save_file)
  
imports: import itertools
  import os
  from typing import Dict, List, Tuple, Union
  import torch
  import torch.nn
  from pytext.data.tensorizers import LabelTensorizer, Tensorizer, TokenTensorizer
  from pytext.models.decoders import DecoderBase
  from pytext.models.decoders.mlp_decoder import MLPDecoder
  from pytext.models.embeddings import EmbeddingBase, EmbeddingList, WordEmbedding
  from pytext.models.model import BaseModel
  from pytext.models.module import create_module
  from pytext.models.output_layers import ClassificationOutputLayer, OutputLayerBase, PairwiseCosineDistanceOutputLayer
  from pytext.models.representations.bilstm_doc_attention import BiLSTMDocAttention
  from pytext.models.representations.docnn import DocNNRepresentation
  from pytext.models.representations.representation_base import RepresentationBase
  from pytext.utils.file_io import PathManager
  from scipy.special import comb
label_desc: Use image node_id 7 for calling the BasePairwiseModel obj's underlying member method code with example usage: obj._save_modules(modules, base_path, suffix) without return types