Python to C++ axis swap

In Python i have

> permute = [2, 1, 0]
> t[:, permute]

How do i do this in C++?

I tried doing:

    std::vector<long> index_vector = {0,1,2};
    auto index_tensor = torch::from_blob((long*) (index_vector.data()),
                       {3}, torch::kLong);
    std::vector<at::indexing::TensorIndex> index;
    index = {"...", "...", index_tensor};
    img_tensor = img_tensor.index(index);

But this does not work