class_docstr: Abstract class for models.
  
  Implements default session checkpoint restore methods.
docstr: Builds the TF graph given a checkpoint file.
  
  Calls into _build_graph_for_generation, which must be implemented by the
  subclass, before restoring the checkpoint.
  
  Args:
    checkpoint_file: The path to the checkpoint file that should be used.
docstr_tok: ["Builds","the","TF","graph","given","a","checkpoint","file",".","Calls","into","_build_graph_for_generation",",","which","must","be","implemented","by","the","subclass",",","before","restoring","the","checkpoint",".","Args",":","checkpoint_file",":","The","path","to","the","checkpoint","file","that","should","be","used","."]
code: def initialize_with_checkpoint(self, checkpoint_file):
      """Builds the TF graph given a checkpoint file.
  
      Calls into _build_graph_for_generation, which must be implemented by the
      subclass, before restoring the checkpoint.
  
      Args:
        checkpoint_file: The path to the checkpoint file that should be used.
      """
      with tf.Graph().as_default():
          self._build_graph_for_generation()
          saver = tf.train.Saver()
          self._session = tf.Session()
          tf.logging.info("Checkpoint used: %s", checkpoint_file)
          saver.restore(self._session, checkpoint_file)
  
file_path: magenta/magenta/models/shared/model.py
imports: import abc
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling the BaseModel obj's underlying member method code with example usage: obj.initialize_with_checkpoint(checkpoint_file) without return types