class_docstr: A collection of options that are passed to the training script
  and can be saved to perform inference later.
  
  Args:
    task: Name of the training task class.
    task_params: A dictionary of parameters passed to the training task.
docstr: Dumps the options to a file in the model directory.
  
  Args:
    model_dir: Path to the model directory. The options will be
    dumped into a file in this directory.
docstr_tok: ["Dumps","the","options","to","a","file","in","the","model","directory",".","Args",":","model_dir",":","Path","to","the","model","directory",".","The","options","will","be","dumped","into","a","file","in","this","directory","."]
code: def dump(self, model_dir):
      """Dumps the options to a file in the model directory.
  
      Args:
        model_dir: Path to the model directory. The options will be
        dumped into a file in this directory.
      """
      gfile.MakeDirs(model_dir)
      options_dict = {
          "model_class": self.model_class,
          "model_params": self.model_params,
      }
  
      with gfile.GFile(TrainOptions.path(model_dir), "wb") as file:
          file.write(json.dumps(options_dict).encode("utf-8"))
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import inspect
  import os
  from collections import defaultdict
  from pydoc import locate
  import json
  import tensorflow
  from tensorflow import gfile
  from seq2seq.contrib import rnn_cell
label_desc: Use image node_id 5 for calling the TrainOptions obj's underlying member method code with example usage: obj.dump(model_dir) without return types