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: Constructs a dict mapping the checkpoint variables to those in new graph.
  
  Returns:
    A dict mapping variable names in the checkpoint to variables in the graph.
docstr_tok: ["Constructs","a","dict","mapping","the","checkpoint","variables","to","those","in","new","graph",".","Returns",":","A","dict","mapping","variable","names","in","the","checkpoint","to","variables","in","the","graph","."]
code: def get_variable_name_dict(self):
      """Constructs a dict mapping the checkpoint variables to those in new graph.
  
      Returns:
        A dict mapping variable names in the checkpoint to variables in the graph.
      """
      var_dict = dict()
      for var in self.variables():
          inner_name = rl_tuner_ops.get_inner_scope(var.name)
          inner_name = rl_tuner_ops.trim_variable_postfixes(inner_name)
          if "/Adam" in var.name:
              # TODO(lukaszkaiser): investigate the problem here and remove this hack.
              pass
          elif self.note_rnn_type == "basic_rnn":
              var_dict[inner_name] = var
          else:
              var_dict[self.checkpoint_scope + "/" + inner_name] = var
  
      return var_dict
  
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 6 for calling the NoteRNNLoader obj's underlying member method code with example usage: obj.get_variable_name_dict() and returns: var_dict