def get_cell_fun(cell_type):
    if (cell_type == 'rnn'):
        cell_fn = tf.nn.rnn_cell.BasicRNNCell
    elif (cell_type == 'lstm'):
        cell_fn = tf.nn.rnn_cell.LSTMCell
    elif (cell_type == 'lstm_block'):
        cell_fn = tf.contrib.rnn.LSTMBlockCell
    elif (cell_type == 'lstm_ln'):
        cell_fn = tf.contrib.rnn.LayerNormBasicLSTMCell
    elif (cell_type == 'lstm_cudnn'):
        cell_fn = tf.contrib.cudnn_rnn.CudnnCompatibleLSTMCell
    elif (cell_type == 'gru'):
        cell_fn = tf.nn.rnn_cell.GRUCell
    elif (cell_type == 'gru_block'):
        cell_fn = tf.contrib.rnn.GRUBlockCell
    elif (cell_type == 'gru_cudnn'):
        cell_fn = tf.contrib.cudnn_rnn.CudnnCompatibleGRUCell
    else:
        cell_fn = tf.nn.rnn_cell.BasicRNNCell
    return cell_fn
def get_cell_fun(cell_type):
    if (cell_type == 'rnn'):
        cell_fn = tf.nn.rnn_cell.BasicRNNCell
    elif (cell_type == 'lstm'):
        cell_fn = tf.nn.rnn_cell.LSTMCell
    elif (cell_type == 'lstm_block'):
        cell_fn = tf.contrib.rnn.LSTMBlockCell
    elif (cell_type == 'lstm_ln'):
        cell_fn = tf.contrib.rnn.LayerNormBasicLSTMCell
    elif (cell_type == 'lstm_cudnn'):
        cell_fn = tf.contrib.cudnn_rnn.CudnnCompatibleLSTMCell
    elif (cell_type == 'gru'):
        cell_fn = tf.nn.rnn_cell.GRUCell
    elif (cell_type == 'gru_block'):
        cell_fn = tf.contrib.rnn.GRUBlockCell
    elif (cell_type == 'gru_cudnn'):
        cell_fn = tf.contrib.cudnn_rnn.CudnnCompatibleGRUCell
    else:
        cell_fn = tf.nn.rnn_cell.BasicRNNCell
    return cell_fn