code: def simple_lstm_decoder(
      features,
      seq_lens,
      batch_size,
      rnn_celltype="lstm",
      rnn_nlayers=2,
      rnn_nunits=128,
      dtype=tf.float32,
  ):
      """Constructs an LSTM-based decoder."""
      x = features
  
      with tf.variable_scope("rnn_input"):
          x = tf.layers.dense(x, rnn_nunits)
  
      if rnn_celltype == "lstm":
          celltype = contrib_rnn.LSTMBlockCell
      else:
          raise NotImplementedError()
  
      cell = rnn.MultiRNNCell(
          [celltype(rnn_nunits) for _ in range(rnn_nlayers)]
      )
  
      with tf.variable_scope("rnn"):
          initial_state = cell.zero_state(batch_size, dtype)
          x, final_state = tf.nn.dynamic_rnn(
              cell=cell,
              inputs=x,
              sequence_length=seq_lens,
              initial_state=initial_state,
          )
  
      return x, initial_state, final_state
  
imports: from magenta.contrib import rnn
  from magenta.models.piano_genie import util
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling a global function with example usage: simple_lstm_decoder(features, seq_lens, batch_size, rnn_celltype, rnn_nlayers, rnn_nunits, dtype) and returns: x,  initial_state,  final_state