How to get mini-batches in pytorch in a clean and efficient way?

maybe useful: