class_docstr: A result object obtained when fitting a model.
class_docstr_tok: ["A","result","object","obtained","when","fitting","a","model","."]
docstr: Serializes all predictos managed by the fit result into the given
  directory. Predictor `i` is saved to subdirectory `model_<i>`.
  
  Args:
      directory: The directory where the predictors should be serialized to.
docstr_tok: ["Serializes","all","predictos","managed","by","the","fit","result","into","the","given","directory",".","Predictor","`","i","`","is","saved","to","subdirectory","`","model_","<","i",">","`",".","Args",":","directory",":","The","directory","where","the","predictors","should","be","serialized","to","."]
code: def serialize_predictors(self, directory: Path) -> None:
      """
      Serializes all predictos managed by the fit result into the given
      directory. Predictor `i` is saved to subdirectory `model_<i>`.
  
      Args:
          directory: The directory where the predictors should be serialized to.
      """
      for i, predictor in enumerate(self.predictors):
          logging.info(
              "Serializing predictor %d/%d...",
              i + 1,
              len(self.predictors),
          )
          path = directory / f"model_{i}"
          path.mkdir(parents=True, exist_ok=True)
          self.config.save_predictor(predictor, path)
  
file_path: gluonts/src/gluonts/nursery/tsbench/src/tsbench/evaluations/training/evaluate.py
imports: import logging
  import os
  from dataclasses import dataclass
  from pathlib import Path
  from typing import List
  from gluonts.env import env
  from gluonts.model.predictor import Predictor
  from tsbench.config import DatasetConfig, ModelConfig
  from tsbench.config.dataset import DatasetSplit
  from tsbench.forecasts import evaluate_forecasts, generate_forecasts
  from .logging import log_metric
label_desc: Use image node_id 2 for calling the FitResult obj's underlying member method code with example usage: obj.serialize_predictors(directory) without return types