Guys, I wanna extend pytorch using C++, however, in my python env, I cannot find libATen.so which will be used for at::Tensor in C++? I installed pytorch by "conda install -c pytorch pytorch ". Donot tell me to install from pytorch source, thanks.
As pytorch is based on C++/C, there should be a library + header files, while I found header files of ATen related in “lib/python3.6/site-packages/torch/lib/include/ATen” but NOT the library. Help!
// #include <torch/torch.h> // You could of course also include everything.
#include <ATen/ATen.h>
using namespace at;
int main(int argc, char** argv) {
Tensor a = ones({2, 2}, kInt);
Tensor b = randn({2, 2});
auto c = a + b.to(kInt);
return 0;
}
Hope it helps, although a little late, but maybe for future readers. I have to admit that I don’t know whether this works for the stable binaries right now. I compiled PyTorch from the master branch on GitHub.