Hi,
I would guess that most of the runtime there comes from the .stack() function, not how you do the slicing.
Also be careful if you’re doing timings on cuda because the api is asynchronous. So you need to introduce torch.cuda.synchronize() to make sure you measure actual runtimes.