The default collate (read “batching”) function tries to torch.stack your data into one Bx… tensor. You’re getting this error because your dimensions A and C vary, but tensors cannot be jagged. In other words, you can’t stack them since the sizes are different.
Since it seems like variable-sized tensors are desired, one solution would be implementing a custom collate callable and supplying it for the DataLoader’s optional collate_fn argument. You’ll receive a list of outputs from the dataset’s __getitem__ of length batch_size and then it’s up to you to stitch them together into however you want your batch.