@ptrblck
Thank you for the confirmation.
For the second approach, the code snippet above throws the
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn when I have the line
                    tile_select = x[:, d_start:d_end, hs, ws].detach()
Instead if I remove the detach
                    tile_select = x[:, d_start:d_end, hs, ws]
it runs. Is that correct?