How would you like to process the variable shaped tensors?
Your custom collate_fn should work now and should return a list with data and target tensors.
However, as the new error message states, you cannot pass a list of tensors to your model, so you could e.g. loop over the data and target pairs and pass the samples one by one to the model.