This does seem like a bug, at the very least it should give a better error message. Do open an issue, thank you.
Saying that, DataLoader can take a custom collate_fn  that you can define, that collates batches as you prefer (instead of using default_collate).