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::IValue> input_tensors;
input_tensors.push_back(torch::from_blob(input, {1, 1, len}, torch::kFloat64));

// Forward pass
torch::Tensor output_tensor = model.forward(input_tensors).toTensor();

// Copy into output
std::memcpy(output_tensor.data_ptr(), output, sizeof(double)*len);