Solved by glaringlee in post #6 
              
              
                @jinchen62 oh, crab…sry…I did not realize the type is not get printed out. 
torch::Tensor ten = torch::rand({12, 12}, torch::TensorOptions(torch::kCPU).dtype(at::kFloat)); 
std::vector<float> v(ten.data_ptr<float>(), ten.data_ptr<float>() + ten.numel());
for (auto a : v) std::cout << a << std::endl;…