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 default MIDI primer file.
  
  Also assigns the steps per bar of this file to be the model's defaults.
docstr_tok: ["Loads","default","MIDI","primer","file",".","Also","assigns","the","steps","per","bar","of","this","file","to","be","the","model","'s","defaults","."]
code: def load_primer(self):
      """Loads default MIDI primer file.
  
      Also assigns the steps per bar of this file to be the model's defaults.
      """
  
      if not os.path.exists(self.midi_primer):
          tf.logging.warn(
              "ERROR! No such primer file exists! %s", self.midi_primer
          )
          return
  
      self.primer_sequence = midi_io.midi_file_to_sequence_proto(
          self.midi_primer
      )
      quantized_seq = sequences_lib.quantize_note_sequence(
          self.primer_sequence, steps_per_quarter=4
      )
      extracted_melodies, _ = melody_pipelines.extract_melodies(
          quantized_seq, min_bars=0, min_unique_pitches=1
      )
      self.primer = extracted_melodies[0]
      self.steps_per_bar = self.primer.steps_per_bar
  
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 9 for calling the NoteRNNLoader obj's underlying member method code with example usage: obj.load_primer() without return types