def _get_rnn_cell(mode, num_layers, input_size, hidden_size,<EOL>dropout, weight_dropout,<EOL>var_drop_in, var_drop_state, var_drop_out,<EOL>skip_connection, proj_size=None, cell_clip=None, proj_clip=None):
assert mode == '<STR_LIT>' and proj_size is not None,'<STR_LIT>'<EOL>assert mode == '<STR_LIT>' and cell_clip is not None,'<STR_LIT>'<EOL>assert mode == '<STR_LIT>' and proj_clip is not None,'<STR_LIT>'<EOL>rnn_cell = rnn.HybridSequentialRNNCell()<EOL>with rnn_cell.name_scope():<EOL><INDENT>for i in range(num_layers):<EOL><INDENT>if mode == '<STR_LIT>':<EOL><INDENT>cell = rnn.RNNCell(hidden_size, '<STR_LIT:relu>', input_size=input_size)<EOL><DEDENT>elif mode == '<STR_LIT>':<EOL><INDENT>cell = rnn.RNNCell(hidden_size, '<STR_LIT>', input_size=input_size)<EOL><DEDENT>elif mode == '<STR_LIT>':<EOL><INDENT>cell = rnn.LSTMCell(hidden_size, input_size=input_size)<EOL><DEDENT>elif mode == '<STR_LIT>':<EOL><INDENT>cell = rnn.GRUCell(hidden_size, input_size=input_size)<EOL><DEDENT>elif mode == '<STR_LIT>':<EOL><INDENT>cell = LSTMPCellWithClip(hidden_size, proj_size,<EOL>cell_clip=cell_clip,<EOL>projection_clip=proj_clip,<EOL>input_size=input_size)<EOL><DEDENT>if var_drop_in + var_drop_state + var_drop_out != <NUM_LIT:0>:<EOL><INDENT>cell = contrib.rnn.VariationalDropoutCell(cell,<EOL>var_drop_in,<EOL>var_drop_state,<EOL>var_drop_out)<EOL><DEDENT>if skip_connection:<EOL><INDENT>cell = rnn.ResidualCell(cell)<EOL><DEDENT>rnn_cell.add(cell)<EOL>if i != num_layers - <NUM_LIT:1> and dropout != <NUM_LIT:0>:<EOL><INDENT>rnn_cell.add(rnn.DropoutCell(dropout))<EOL><DEDENT>if weight_dropout:<EOL><INDENT>apply_weight_drop(rnn_cell, '<STR_LIT>', rate=weight_dropout)<EOL><DEDENT><DEDENT><DEDENT>return rnn_cell<EOL>
create rnn cell given specs

    Parameters
    ----------
    mode : str
        The type of RNN cell to use. Options are 'lstmpc', 'rnn_tanh', 'rnn_relu', 'lstm', 'gru'.
    num_layers : int
        The number of RNN cells in the encoder.
    input_size : int
        The initial input size of in the RNN cell.
    hidden_size : int
        The hidden size of the RNN cell.
    dropout : float
        The dropout rate to use for encoder output.
    weight_dropout: float
        The dropout rate to the hidden to hidden connections.
    var_drop_in: float
        The variational dropout rate for inputs. Won’t apply dropout if it equals 0.
    var_drop_state: float
        The variational dropout rate for state inputs on the first state channel.
        Won’t apply dropout if it equals 0.
    var_drop_out: float
        The variational dropout rate for outputs. Won’t apply dropout if it equals 0.
    skip_connection : bool
        Whether to add skip connections (add RNN cell input to output)
    proj_size : int
        The projection size of each LSTMPCellWithClip cell.
        Only available when the mode=lstmpc.
    cell_clip : float
        Clip cell state between [-cellclip, cell_clip] in LSTMPCellWithClip cell.
        Only available when the mode=lstmpc.
    proj_clip : float
        Clip projection between [-projclip, projclip] in LSTMPCellWithClip cell
        Only available when the mode=lstmpc.