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: Primes the model with its default midi primer.
docstr_tok: ["Primes","the","model","with","its","default","midi","primer","."]
code: def prime_model(self):
      """Primes the model with its default midi primer."""
      with self.graph.as_default():
          tf.logging.debug(
              "Priming the model with MIDI file %s", self.midi_primer
          )
  
          # Convert primer Melody to model inputs.
          encoder = note_seq.OneHotEventSequenceEncoderDecoder(
              note_seq.MelodyOneHotEncoding(
                  min_note=rl_tuner_ops.MIN_NOTE,
                  max_note=rl_tuner_ops.MAX_NOTE,
              )
          )
  
          primer_input, _ = encoder.encode(self.primer)
  
          # Run model over primer sequence.
          primer_input_batch = np.tile(
              [primer_input], (self.batch_size, 1, 1)
          )
          self.state_value, softmax = self.session.run(
              [self.state_tensor, self.softmax],
              feed_dict={
                  self.initial_state: self.state_value,
                  self.melody_sequence: primer_input_batch,
                  self.lengths: np.full(
                      self.batch_size, len(self.primer), dtype=int
                  ),
              },
          )
          priming_output = softmax[-1, :]
          self.priming_note = self.get_note_from_softmax(priming_output)
  
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 10 for calling the NoteRNNLoader obj's underlying member method code with example usage: obj.prime_model() without return types