Solved by teddykoker in post #4 
              
              
                I think I figured it out: I can use std::memcpy(): 
double* input;  // address of input
double* output; // address of output
int len = 1000; // length of input and output buffers
torch::jit::script::Module model; // model loaded in from torchscript

// Convert input to tensor
std::vector<torch::jit:…