I am developing a C++ library with LibTorch and want to use its C++ frontend on Android.
I’ve successfully linked LibTorch to the library by unpacking the official AAR release, but it seems like I cannot use
torch/torch.h from it. I found this header in
headers/torch/csrc/api/include/torch/torch.h but if I include this directory to use
#include <torch/torch.h> in my code I get this error:
In file included from <my project>\app\src\main\cpp\Test.cpp:6: In file included from <my project>\app\.cxx\Debug\x311e382\x86_64\_deps\torch-src\headers\torch\csrc\api\include\torch\torch.h:3: In file included from <my project>\app\.cxx\Debug\x311e382\x86_64\_deps\torch-src\headers\torch\csrc\api\include\torch\all.h:13: In file included from <my project>\app\.cxx\Debug\x311e382\x86_64\_deps\torch-src\headers\torch\csrc\api\include\torch\nn.h:4: In file included from <my project>\app\.cxx\Debug\x311e382\x86_64\_deps\torch-src\headers\torch\csrc\api\include\torch\nn\functional.h:11: In file included from <my project>\app\.cxx\Debug\x311e382\x86_64\_deps\torch-src\headers\torch\csrc\api\include\torch\nn\functional\normalization.h:4: <my project>\app\.cxx\Debug\x311e382\x86_64\_deps\torch-src\headers\torch\csrc\api\include\torch\nn\functional\padding.h:4:10: fatal error: 'ATen/native/PadNd.h' file not found
The Making Native Android Application that uses PyTorch prebuilt libraries article doesn’t explicitly include
headers/torch/csrc/api/include directory, so does this mean that PyTorch’s C++ frontend is unavailable on Android?