int64_t array[] = {1, 2};
torch::Tensor tensor = torch::from_blob(array, {2}, torch::kInt64);
std::cout << tensor << std::endl;

So that solves your data problem. But I still find it strange, that you try to feed a float through your net and expect it to output an int. I dont know your architecture, but it maybe worth checking that as well.