Solved by yf225 in post #3 
              
              
                Starting from the current nightly build (and PyTorch 1.5 soon), for 
a[1:10:2, :, None, :]

we can write 
using namespace torch::indexing;
a.index({Slice(1, 10, 2), Slice(), None, Slice()});

Here is the general translation for Tensor::index and Tensor::index_put_ functions: 
Python             C++ …