Recently I’m trying to load sentence features with different sizes, where the first dimension indicates the number of words in the sentence.
train_loader = torch.utils.data.DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=True, num_workers=10, pin_memory=True)
But it reports RuntimeError: inconsistent tensor size at /py/conda-bld/pytorch_1493673470840/work/torch/lib/TH/generic/THTensorCopy.c…
And my tensor sizes are like:
[20,1000]
[15,1000]
[18,1000]
[6,1000]…
Any suggestions as to how should I fix it?