Torch::zeros creation

I want to create a torch::zeros based on a dimension which comes from a std::vector<int> vec. Apparently it is not possible to create a tensor by torch::zeros(vec), since it only accepts the rvalue of arrays like {a,b,c} or c10::ArrayRef. Since the length of my size vec changes, I cannot use {a,b,c} and I have to follow the second approach. Any idea how can I convert a std:vector to c10::ArrayRef?

I also tried passing an array by int* vec = &vec[0];, still got type conversion error for the api.
Also, I tried to create an arrayRef via auto dims = c10::ArrayRef<int64_t>(vec.size());, but torch did not like its syntax.

Following code compiles and runs as expected (at least with MSVC and win 10), or maybe I am missing something ? :thinking:

std::vector<int64_t> vec;

auto t = torch::zeros(vec);
std::cout << t << std::endl;

Thanks!, it worked now. The problem was that my input std::vector initially was not int64_t and it was int.