It works for me:
#include <torch/torch.h>
#include <iostream>


int main(){
    torch::Tensor x = torch::rand({2, 3, 2});
    std::cout << "Torch Tensor" << std::endl;
    std::cout << x << std::endl;
    std::vector<torch::Tensor> v;
    v.push_back(x);
    torch::TensorList z = torch::TensorList(v);
    std::cout << "Torch TensorList 1st element" << std::endl;
    std::cout << z[0] << std::endl;
    return 0;
}

And it should work always, since TensorList is an ArrayRef of tensors 7 and ArrayRef implements a constructor from std::vector 9.