I have a model that excepts an input of shape [1, 1, 1000]. I am creating a real-time application in which I would like to feed in a buffer (of type double*) into the model, and then write the output back into the buffer. I am having trouble with the double* to torch::Tensor conversion and back.
Example Python:
input = torch.rand(1, 1, 1000)
input = model(input)

C++:
double* input; // written to by some other function
int len = 1000;
torch::jit::script::Module model; // loaded in from torchscript
/* 
Now how do I convert input into a tensor of shape [1, 1, len],
pass it through the model, and convert it back into an array of
type double*
*/

// EDIT: figured out conversion to tensor
std::vector<torch::jit::IValue> input_tensors;
input_tensors.push_back(torch::from_blob(input, {1, 1, len}, torch::kFloat64));
torch::Tensor output_tensor = model.forward(input_tensors).toTensor();
// now how do copy back into double*

Thanks in advance!