You can create a “batch” of tensors with different shapes by using e.g. a list (and a custom collate_fn in the DataLoader). However, you won’t be able to pass this list of tensors to the model directly and would either have to pass them one by one or create a single tensor after cropping/padding the tensors.
I don’t know how far the implementation of nested tensors is, but this utility would allow you to use a tensor object containing differently shaped tensors internally.