'Writes the checkpoint and metagraph.
Args:
checkpoint_filename: Path to the checkpoint file.'

def write_checkpoint_with_metagraph(self, checkpoint_filename):

    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)
