I am trying to convert my c++ vector to a torch tensor. However, my code is returning incorrect conversions.
cout << history << endl;
auto options1 = torch::TensorOptions().dtype(torch::kFloat32);
input = torch::from_blob(history.data(), {size, 1, 6}, options1).to(torch::kFloat32);
cout << input << endl;
The above code returns the following output:
-9 -3 -3 -12 -0 -0 -12 -2 -3 -12 -0 -0
(1,.,.) =
-9.8681e-32 4.5793e-41 -9.8682e-32 4.5793e-41 -9.8682e-32 4.5793e-41
(2,.,.) =
-9.8682e-32 4.5793e-41 -9.8683e-32 4.5793e-41 -9.8683e-32 4.5793e-41
[ CPUFloatType{2,1,6} ]