I transfer data from  tensor to vector as follow:
vector box_vec;
torch::Tensor out1 = outputs->elements()[0].toTensor();
auto box_temp = out1.view({ 1 ,21708*4 }).to(torch::kCPU);
for (int i = 0; i < 21708 * 4; i++) { box_vec.push_back(box_temp[0][i].item().toFloat());
How to transfer data from  tensor to vector with libtorch directly?