If your input batch contains a list of lists, I assume each tensor in the nested list has a different shape?
If that’s the case, you could pad the tensors so that they have the same shape, and stack them to a single tensor.
Currently PyTorch modules do not accept a batch with differently shaped tensors out of the box.