Usually pin_memory is used when creating dataloaders, to allow CUDA to use DMA (direct memory access), but I noticed that it’s also possible to create tensors with pin_memory=True.
I’m curious what happens if I slice a tensor in pinned memory. My guess is that CPU would have to first copy the sliced tensor to pinned memory and then let CUDA copy from it. Am I right?