@stanis-morozov could you please explain how do you want to stack together in a single batch (torch.tensor) images of variable size ?
In your new collate function:
def my_collate(batch):
    elem_type = type(batch[0])
    if isinstance(batch[0], torch.Tensor):
        return batch

what is the type(batch), a list/tuple ?