I think you can use torch::from_blob.
Take a look at the comment in this old issue
‘https://github.com/pytorch/pytorch/issues/37201 10’
You need to specify torch::kFloat64 as the input type in torch::from_blob in your case.