I passed compiling codes as instruction, but when I run on the windows 10,
the following error came out, anybody can creating network by using libtorch c++ on windows, could you help me?
and It runs normally on Linux.
#include <torch/torch.h>
// Define a new Module.
struct Net : torch::nn::Module {
Net() {
// Construct and register two Linear submodules.
fc1 = register_module("fc1", torch::nn::Linear(8, 64));
fc2 = register_module("fc2", torch::nn::Linear(64, 1));
}
// Implement the Net's algorithm.
torch::Tensor forward(torch::Tensor x) {
// Use one of many tensor manipulation functions.
x = torch::relu(fc1->forward(x));
x = torch::dropout(x, /*p=*/0.5);
x = torch::sigmoid(fc2->forward(x));
return x;
}
// Use one of many "standard library" modules.
torch::nn::Linear fc1{nullptr}, fc2{nullptr};
};
int main(int argc, char* argv[]){
// Create a new Net.
Net net;
return 0;
}