def onehottensors2classlist(onehottensor, seq_lens):
    """
    Converts a 3d tensor (seq_len, batch_size, output_dim) to a 2d class list (list[batch_size  * list[seq_len]])
        where each class is a unique integer
    Arguments:
        onehottensor (torch.tensor) : 3d padded one-hot tensor of different sequence lengths of
            shape (max(seq_lens), batch_size, output_dim)
        seq_lens (list[int]) : length of each of the sequences without padding 
            (i.e. onehottensor.shape[1] without padding)
    Returns:
        batch_list (list[list[int]]) : list of class lists with each internal list corresponding
            to a sequence and each class in the internal list corresponding to a class for 
            each step of the sequence
    """
    batch_list = []
    
    for idx in range(0, onehottensor.shape[1]):     # for every tensor sample in batch
        integer_list = []
        tensor2d = onehottensor[:seq_lens[idx], idx, :]          # shape (seq_len, dim)
        max_classes = tensor2d.max(dim=1)
        integer_list = max_classes[1].tolist()
        
        batch_list.append(integer_list)
    
    return batch_list