torch::nn::Sequential error with Libtorch in windows

my os:
windows 10
libtorch 1.1
visual studio 2015

when I code like this:
#include “torch/script.h”
#include “torch/torch.h”
using namespace std;
using namespace torch;
int main()
nn::Sequential(nn::Conv2d(nn::Conv2dOptions(10, 256, 4)
cout << “Hello LibTorch” << endl;
return 0;

I compiled and got the error:

D:\BUILD\libtorch_release_110\include\torch/csrc/utils/variadic.h(195): error C2059: syntax error: ‘template’
D:\BUILD\libtorch_release_110\include\torch/csrc/utils/variadic.h(190): note: see reference to function template instantiation ‘ReturnType torch::unpack<ReturnType,const at::Tensor&,torch::nn::AnyModule::Holder<torch::nn::Conv2dImpl,const at::Tensor &>::InvokeForward,torch::nn::AnyModule::Holder<torch::nn::Conv2dImpl,const at::Tensor &>::CheckedGetter,0>(Function,Accessor,torch::Indices<0>)’ being compiled
Function=torch::nn::AnyModule::Holder<torch::nn::Conv2dImpl,const at::Tensor &>::InvokeForward,
Accessor=torch::nn::AnyModule::Holder<torch::nn::Conv2dImpl,const at::Tensor &>::CheckedGetter

anyone can solve the problem?

I met the same error,did you find the solution? my os:
win 7
libtorch 1.0
visual studio 2015

sorry, I have no idea about this issue. Look forward to someone official that can deal with it!:joy:

I just posted something that could be related:

It could be related because the first errors messages I got with Sequential were quite nebulous. I had to use SequentialImpl to get a decent error message and from there I could find a solution to my problem.