def METHOD_NAME(inputs, seq_len):
    merge = merge_repeated
    output_len = np.array([]).astype(np.int32)
    val = np.array([]).astype(np.int32)
    for i in range(batch):
        prev_id = 0
        t_dec = 0
        len_i = seq_len[i] if seq_len is not None else max_time
        for t in range(len_i):
            max_id = np.argmax(inputs[t, i, :])
            if max_id == 0:
                prev_id = max_id
                continue
            if max_id == prev_id and merge:
                prev_id = max_id
                continue
            t_dec += 1
            val = np.append(val, max_id)
            prev_id = max_id
        output_len = np.append(output_len, t_dec)
    return [output_len, val]