code: def add_model(self, model, epoch, **kwargs):
      if not all(
          metric_name in kwargs for metric_name in self.metrics.keys()
      ):
          raise ValueError(
              "All metrics defined in the constructor must be reported. "
              "Expected metrics: " + ", ".join(self.metrics.keys())
          )
  
      model_path = Path(self.save_directory).joinpath(
          "model_epoch_{}.pt".format(epoch)
      )
      torch.save(model.state_dict(), model_path)
      model_id = tuple(
          kwargs[metric.name] for metric in self.metrics.values()
      ) + (epoch, len(self.models))
      self.models[model_id] = model_path
  
file_path: small-text/small_text/integrations/pytorch/model_selection.py
imports: import logging
  from collections import OrderedDict
  from pathlib import Path
  from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
  from small_text.utils.annotations import deprecated
label_desc: Use image node_id 2 for calling the PytorchModelSelection obj's underlying member method code with example usage: obj.add_model(model, epoch) without return types