(sents, pad_token)
return sents_padded
Pad list of sentences according to the longest sentence in the batch.
    @param sents (list[list[int]]): list of sentences, where each sentence
                                    is represented as a list of words
    @param pad_token (int): padding token
    @returns sents_padded (list[list[int]]): list of sentences where sentences shorter
        than the max length sentence are padded out with the pad_token, such that
        each sentences in the batch now has equal length.
        Output shape: (batch_size, max_sentence_length)
Pad list of sentences according to the longest sentence in the batch.
Pad list of sentences according to the longest sentence in the batch .
def pad_sents(sents, pad_token):
    """ Pad list of sentences according to the longest sentence in the batch.
    @param sents (list[list[int]]): list of sentences, where each sentence
                                    is represented as a list of words
    @param pad_token (int): padding token
    @returns sents_padded (list[list[int]]): list of sentences where sentences shorter
        than the max length sentence are padded out with the pad_token, such that
        each sentences in the batch now has equal length.
        Output shape: (batch_size, max_sentence_length)
    """
    sents_padded = []

    ### COPY OVER YOUR CODE FROM ASSIGNMENT 4
    max_length = -1
    for s in sents:
        max_length = max(max_length, len(s))
    for s in sents:
        sents_padded.append(s[:] + [pad_token]*(max_length-len(s)))
    ### END YOUR CODE FROM ASSIGNMENT 4

    return sents_padded
def pad_sents ( sents , pad_token ) : sents_padded = [ ] ### COPY OVER YOUR CODE FROM ASSIGNMENT 4 max_length = - 1 for s in sents : max_length = max ( max_length , len ( s ) ) for s in sents : sents_padded . append ( s [ : ] + [ pad_token ] * ( max_length - len ( s ) ) ) ### END YOUR CODE FROM ASSIGNMENT 4 return sents_padded