This question seems to be related to https://github.com/pytorch/pytorch/issues/38319 11
Copy the options from there:

You can use the prebuilt binaries we released for mobile, see details: https://pytorch.org/mobile/home/ 4

You can build it from source on your own for Android using the following script:

scripts/build_pytorch_android.sh


If you don’t want to use the JNI wrapper, you can also use the C++ API directly from your Android C++ code. This is not officially supported yet, but here is a simple example: https://github.com/ljk53/pytorch-android-cpp-demo 7


For option 1 & option 2, you will get libtorch built in the form of Android AAR (https://stackoverflow.com/questions/23915619/android-archive-library-aar-vs-standard-jar 1), which provides Java API and can be called from your Java code on Android.
If you want to call libtorch C++ API in your mobile app directly, you can try Option 3 (which is not well supported yet) - please check out the example code and follow README to see how it works.