About loading lmdb dataset

I originally use caffe, and now I have convert model trained by caffe to pytorch. And in caffe I use lmdb package the training images. I also read these lmdb in pytorch. But I do not know how to read the images from lmdb in batchsize. Now I only read one by one.

Could anybody give me some suggestion?