How to pad a batch of documents?
I solved this problem by using a keras function:
torch.tensor(tf.keras.preprocessing.sequence.pad_sequences(doc1,maxlen=longest_sent,padding='post')

torch.tensor(tf.keras.preprocessing.sequence.pad_sequences(doc2,maxlen=longest_sent,padding='post')