Hi,
I have a vector of int. All I want is to convert such vector into torch tensor.
I tried this:
vector<int> x = {10, 15, 20, 100, 500};
vector<torch::jit::IValue> inputs;
inputs.push_back(torch::from_blob(x.data(), {1, x.size()}, torch::kInt64));

But that returns me different numbers(see below).
6.4425e+10  4.2950e+11  1.3972e+14  2.5700e+02  9.4817e+13
[ Variable[CPULongType]{1,5} ]

What I can still do is  this:
vector<int> x = {10, 15, 20, 100, 500};
vector<torch::jit::IValue> inputs;
torch::Tensor t = torch::zeros({1, (int)x.size()}, torch::kInt64);
int counter = 0;
for (int i : x)
{
    t[0][counter] = i;
    counter++;
}
inputs.push_back(t);

But is not there other way how to convert vector into torch::Tensor?