#include #define XLExport extern "C" __declspec(dllexport) XLExport int _stdcall MLP_DLL(); int _stdcall MLP_DLL() { std::ofstream log("output.txt"); torch::Device device(torch::kCPU); if (torch::cuda::is_available()) { log << "Cuda found" << std::endl; device = torch::Device(torch::kCUDA); } auto Net = torch::nn::Conv1d(torch::nn::Conv1dOptions(21, 2, 3)); Net->to(device); torch::Tensor X = torch::rand({ 5,21,25 }).to(device); log << " starting forward" << std::endl; torch::Tensor Y = Net->forward(X); log << "Y = " << std::endl; log << Y << std::endl; return 0; }