def METHOD_NAME(inputs, pad_id, max_length=-1):
    for ids in inputs:
        max_length = max(max_length, len(ids))
    def extend_max_lenth(value, max_length, to_pad_id):
        return [to_pad_id] * (max_length - len(value)) + value
    def extend_filed(values, max_length, to_pad_id):
        res = []
        for value in values:
            res.append(extend_max_lenth(value.tolist(), max_length, to_pad_id))
        return res
    res = extend_filed(inputs, max_length, pad_id)
    return paddle.to_tensor(res)