How can i use nn.LSTM with variable-length sequences and without padding?
In code below, torch.utils.data.DataLoader concatenates each single tensor to construct mini batch data. This makes me pad the each sequence to make the tensor of fixed size.
cap = CocoCaptions(root = './data/train2014resized',
                   annFile = './data/annotations/captions_train2014.json',
                   vocab = vocab,
                   transform=transform,
                   target_transform=transforms.ToTensor())

data_loader = torch.utils.data.DataLoader(
    cap, batch_size=16, shuffle=True, num_workers=2)

for i, (images, input_seqs, target_seqs, masks) in enumerate(data_loader):
    # images: a tensor of shape (batch_size, 3, 256, 256).
    # input_seqs, target_seqs, masks: tensors of shape (batch_size, padded_length).