The sampler implements a strategy to sample observations from the indices.
Have a look at the docs 19 for the provided samplers.
There is also an explanation regarding pin_memory 22.

Host to GPU copies are much faster when they originate from pinned (page-locked) memory.

This will not speed up the GPU operation, but the copies between the host and the GPU.
Also, it shouldn’t run out of memory.