So the advance indexing does it’s best to avoid copy, but sometimes it has to do.
If you absolutely want to avoid copies, you can use .select() and .narrow() to make sure you will always have copy-free subsets of your tensor.
I don’t remember where the advance indexing code is, but it’s a few hundred lines of cpp somewhere