class_docstr: Abstract class for models.
  
  Implements default session checkpoint restore methods.
docstr: Writes the checkpoint and metagraph.
  
  Args:
    checkpoint_filename: Path to the checkpoint file.
docstr_tok: ["Writes","the","checkpoint","and","metagraph",".","Args",":","checkpoint_filename",":","Path","to","the","checkpoint","file","."]
code: def write_checkpoint_with_metagraph(self, checkpoint_filename):
      """Writes the checkpoint and metagraph.
  
      Args:
        checkpoint_filename: Path to the checkpoint file.
      """
      with self._session.graph.as_default():
          saver = tf.train.Saver(
              sharded=False, write_version=tf.train.SaverDef.V1
          )
          saver.save(
              self._session,
              checkpoint_filename,
              meta_graph_suffix="meta",
              write_meta_graph=True,
          )
  
file_path: magenta/magenta/models/shared/model.py
imports: import abc
  import tensorflow.compat.v1
label_desc: Use image node_id 5 for calling the BaseModel obj's underlying member method code with example usage: obj.write_checkpoint_with_metagraph(checkpoint_filename) without return types