class_docstr: Registered as a `Trainer` with name "no_op".
class_docstr_tok: ["Registered","as","a","`","Trainer","`","with","name","``","no_op","''","."]
docstr: A trivial trainer to assist in making model archives for models that do not actually
  require training. For instance, a majority class baseline.
  
  In a typical AllenNLP configuration file, neither the `serialization_dir` nor the `model`
  arguments would need an entry.
docstr_tok: ["A","trivial","trainer","to","assist","in","making","model","archives","for","models","that","do","not","actually","require","training",".","For","instance",",","a","majority","class","baseline",".","In","a","typical","AllenNLP","configuration","file",",","neither","the","`","serialization_dir","`","nor","the","`","model","`","arguments","would","need","an","entry","."]
code: def __init__(self, serialization_dir: str, model: Model) -> None:
      """
      A trivial trainer to assist in making model archives for models that do not actually
      require training. For instance, a majority class baseline.
  
      In a typical AllenNLP configuration file, neither the `serialization_dir` nor the `model`
      arguments would need an entry.
      """
  
      super().__init__(serialization_dir, cuda_device=-1)
      self.model = model
      self._best_model_filename: Optional[str] = None
  
file_path: allennlp/allennlp/training/no_op_trainer.py
imports: import os
  from typing import Any, Dict, Optional
  import torch
  from allennlp.models import Model
  from allennlp.training.checkpointer import Checkpointer
  from allennlp.training.trainer import Trainer, TrainerCheckpoint
label_desc: Use image node_id 1 to create a new NoOpTrainer object from inherited base classes: Trainer with example: obj = NoOpTrainer(serialization_dir, model)