问题描述
我正在尝试将我的c ++向量转换为割炬张量。但是,我的代码返回的转换错误。
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;
上面的代码返回以下输出:
-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,6} ]
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)