class_docstr: Builds graph for a Note RNN and instantiates weights from a checkpoint.
  
  Loads weights from a previously saved checkpoint file corresponding to a pre-
  trained basic_rnn model. Has functions that allow it to be primed with a MIDI
  melody, and allow it to be called to produce its predictions for the next
  note in a sequence.
  
  Used as part of the RLTuner class.
class_docstr_tok: ["Builds","graph","for","a","Note","RNN","and","instantiates","weights","from","a","checkpoint",".","Loads","weights","from","a","previously","saved","checkpoint","file","corresponding","to","a","pre-","trained","basic_rnn","model",".","Has","functions","that","allow","it","to","be","primed","with","a","MIDI","melody",",","and","allow","it","to","be","called","to","produce","its","predictions","for","the","next","note","in","a","sequence",".","Used","as","part","of","the","RLTuner","class","."]
docstr: Loads model weights from a saved checkpoint.
  
  Args:
    checkpoint_dir: Directory which contains a saved checkpoint of the
      model.
docstr_tok: ["Loads","model","weights","from","a","saved","checkpoint",".","Args",":","checkpoint_dir",":","Directory","which","contains","a","saved","checkpoint","of","the","model","."]
code: def restore_vars_from_checkpoint(self, checkpoint_dir):
      """Loads model weights from a saved checkpoint.
  
      Args:
        checkpoint_dir: Directory which contains a saved checkpoint of the
          model.
      """
      tf.logging.info("Restoring variables from checkpoint")
  
      var_dict = self.get_variable_name_dict()
      with self.graph.as_default():
          saver = tf.train.Saver(var_list=var_dict)
  
      tf.logging.info("Checkpoint dir: %s", checkpoint_dir)
      checkpoint_file = tf.train.latest_checkpoint(checkpoint_dir)
      if checkpoint_file is None:
          tf.logging.warn(
              "Can't find checkpoint file, using %s",
              self.checkpoint_file,
          )
          checkpoint_file = self.checkpoint_file
      tf.logging.info("Checkpoint file: %s", checkpoint_file)
  
      saver.restore(self.session, checkpoint_file)
  
imports: import os
  from magenta.common import sequence_example_lib
  from magenta.models.rl_tuner import rl_tuner_ops
  from magenta.models.shared import events_rnn_graph
  from magenta.pipelines import melody_pipelines
  import note_seq
  from note_seq import midi_io
  from note_seq import sequences_lib
  import numpy
  import tensorflow.compat.v1
  import tf_slim
label_desc: Use image node_id 8 for calling the NoteRNNLoader obj's underlying member method code with example usage: obj.restore_vars_from_checkpoint(checkpoint_dir) without return types