pytorch学习(一):torch.nn.utils.rnn.pack_padded_sequence()的用法
torch.nn.utils.rnn.pack_padded_sequence()的用法:targets=pack_padded_sequence(captions,lengths,batch_first=True)[0]输入的caption是长度不同的句子返回的targets是打包成一条后的captionstensor([[1,8,1704,47,12,56,158,3,11,344,6,20,