@glaringlee You might have identified the issue coming after this! It does not solve the original issue, however.
This standalone script:
#include <torch/script.h> // One-stop header.
#include <vector>
#include <iostream>
#include <memory>

int main(int argc, char** argv)
{
    std::cout << "Start successful\n";
    std::vector<double> wavData = std::vector<double>(5);
    int len = wavData.size();
    auto options = torch::TensorOptions().dtype(torch::kFloat64);
    torch::from_blob(wavData, {1, len}, options);
}

Produces the following error:
to_tensor_test.cpp.o
filepath/to_tensor_test.cpp: In function ‘int main(int, char**)’:
filepath/to_tensor_test.cpp:12:48: error: no matching function for call to ‘from_blob(std::vector<double, std::allocator<double> >&, <brace-enclosed initializer list>, c10::TensorOptions&)’
     torch::from_blob(wavData, {1, len}, options);
                                                ^
In file included from filepath/libtorch/include/torch/csrc/api/include/torch/types.h:7:0,
                 from filepath/libtorch/include/torch/script.h:3,
                 from filepath/to_tensor_test.cpp:1:
filepath/libtorch/include/torch/csrc/autograd/generated/variable_factories.h:57:19: note: candidate: at::Tensor torch::from_blob(void*, c10::IntArrayRef, c10::IntArrayRef, const Deleter&, const c10::TensorOptions&)
 inline at::Tensor from_blob(
                   ^~~~~~~~~
filepath/libtorch/include/torch/csrc/autograd/generated/variable_factories.h:57:19: note:   candidate expects 5 arguments, 3 provided
filepath/libtorch/include/torch/csrc/autograd/generated/variable_factories.h:76:19: note: candidate: at::Tensor torch::from_blob(void*, c10::IntArrayRef, c10::IntArrayRef, const c10::TensorOptions&)
 inline at::Tensor from_blob(
                   ^~~~~~~~~
filepath/libtorch/include/torch/csrc/autograd/generated/variable_factories.h:76:19: note:   no known conversion for argument 1 from ‘std::vector<double, std::allocator<double> >’ to ‘void*’
filepath/libtorch/include/torch/csrc/autograd/generated/variable_factories.h:95:19: note: candidate: at::Tensor torch::from_blob(void*, c10::IntArrayRef, const Deleter&, const c10::TensorOptions&)
 inline at::Tensor from_blob(
                   ^~~~~~~~~
filepath/libtorch/include/torch/csrc/autograd/generated/variable_factories.h:95:19: note:   no known conversion for argument 1 from ‘std::vector<double, std::allocator<double> >’ to ‘void*’
filepath/libtorch/include/torch/csrc/autograd/generated/variable_factories.h:112:19: note: candidate: at::Tensor torch::from_blob(void*, c10::IntArrayRef, const c10::TensorOptions&)
 inline at::Tensor from_blob(
                   ^~~~~~~~~
filepath/libtorch/include/torch/csrc/autograd/generated/variable_factories.h:112:19: note:   no known conversion for argument 1 from ‘std::vector<double, std::allocator<double> >’ to ‘void*’
CMakeFiles/to_tensor_test.dir/build.make:82: recipe for target 'CMakeFiles/to_tensor_test.dir/to_tensor_test.cpp.o' failed
make[3]: *** [CMakeFiles/to_tensor_test.dir/to_tensor_test.cpp.o] Error 1
CMakeFiles/Makefile2:95: recipe for target 'CMakeFiles/to_tensor_test.dir/all' failed
make[2]: *** [CMakeFiles/to_tensor_test.dir/all] Error 2
CMakeFiles/Makefile2:102: recipe for target 'CMakeFiles/to_tensor_test.dir/rule' failed
make[1]: *** [CMakeFiles/to_tensor_test.dir/rule] Error 2
Makefile:138: recipe for target 'to_tensor_test' failed
make: *** [to_tensor_test] Error 2

CLion also puts a red line below torch::from_blob with the following:

No matching function for call to ‘from_blob’. candidate function not viable: requires at least 4 arguments, but 3 were provided

Note that I’m using C++ 17 (cannot use 14)