code: def create_rnn_encoder(
      x,
      rnn_units,
      dropout_rate,
      seq_length,
      rnn_cell_type,
      param_initializer,
      seed,
      reuse=None,
  ):
      with tf.variable_scope("RNN_Encoder", reuse=reuse):
          rnn_cell = create_rnn_cell(
              rnn_cell_type, rnn_units, param_initializer
          )
          rnn_cell = tf.nn.rnn_cell.DropoutWrapper(
              rnn_cell, input_keep_prob=1 - dropout_rate, seed=seed
          )
          init_state = rnn_cell.zero_state(tf.shape(x)[0], tf.float32)
          # RNN Encoder: Iteratively compute output of recurrent network
          rnn_outputs, _ = tf.nn.dynamic_rnn(
              rnn_cell,
              x,
              initial_state=init_state,
              sequence_length=seq_length,
              dtype=tf.float32,
          )
          return rnn_outputs
  
file_path: cornac/cornac/models/beacon/beacon_tf.py
imports: import numpy
  import warnings
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling a global function with example usage: create_rnn_encoder(x, rnn_units, dropout_rate, seq_length, rnn_cell_type, param_initializer, seed, reuse) and returns: rnn_outputs