That’s because you didn’t use torch.h in this demo.
I am meeting the same error in another demo from https://github.com/iamhankai/cpp-pytorch 109
there’s no Tensor.h in libtorch/include/torch
Damn it and I really didn’t know how to go on…