Libtorch:how to create tensor from tensorRT fp16 half type pointer?

how to create tensor from tensorRT fp16 half type pointer in libtorch?
I am working on a detection model. I change the backbone of it to tensorRT to do FP16 inference, and the detection code such as decode boxes and nms is done in libtorch and torchvisoin, so how to create fp16 tensor from tensorRT half type pointers?
The important code is to illustrate the issue:

// tensorRT code to get half type outpus
half_float::half* outputs[18];
doInference(*engine, data, outputs, 1);
// to get the final outputs with libtorch
vector<torch::Tensor> output;
//???? how to feed the date in outpus to output????
// get the result with libtorch method detect_trt->forward
 auto res = detect_trt->forward(output); 

Thanks in advance.

Let’s discuss this here: