You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where `org.pytorch:pytorch_android` is the main dependency with PyTorch Android API, including libtorch native library for all 4 android abis (armeabi-v7a, arm64-v8a, x86, x86_64).
@@ -81,11 +82,11 @@ As a first step we read `image.jpg` to `android.graphics.Bitmap` using the stand
`org.pytorch.Module` represents `torch::jit::script::Module` that can be loaded with `load` method specifying file path to the serialized to file model.
89
+
`org.pytorch.Module` represents `torch::jit::mobile::Module` that can be loaded with `load` method specifying file path to the serialized to file model.
After successful build you can integrate the result aar files to your android gradle project, following the steps from previous section of this tutorial (Building PyTorch Android from Source).
391
392
393
+
## Use PyTorch JIT interpreter
394
+
395
+
PyTorch JIT interpreter is the default interpreter before 1.9 (a version of our PyTorch interpreter that is not as size-efficient). It will still be supported in 1.9, and can be used via `build.gradle`:
Watch the following [video](https://youtu.be/5Lxuu16_28o) as PyTorch Partner Engineer Brad Heintz walks through steps for setting up the PyTorch Runtime for Android projects:
Copy file name to clipboardExpand all lines: _mobile/home.md
+1-2
Original file line number
Diff line number
Diff line change
@@ -24,15 +24,14 @@ PyTorch Mobile is in beta stage right now, and is already in wide scale producti
24
24
* Support for tracing and scripting via TorchScript IR
25
25
* Support for XNNPACK floating point kernel libraries for Arm CPUs
26
26
* Integration of QNNPACK for 8-bit quantized kernels. Includes support for per-channel quantization, dynamic quantization and more
27
-
*Build level optimization and selective compilation depending on the operators needed for user applications, i.e., the final binary size of the app is determined by the actual operators the app needs
27
+
*Provides an [efficient mobile interpreter in Android and iOS](https://pytorch.org/tutorials/prototype/lite_interpreter.html). Also supports build level optimization and selective compilation depending on the operators needed for user applications (i.e., the final binary size of the app is determined by the actual operators the app needs).
28
28
* Streamline model optimization via optimize_for_mobile
29
29
* Support for hardware backends like GPU, DSP, and NPU will be available soon in Beta
30
30
31
31
32
32
## Prototypes
33
33
We have launched the following features in prototype, available in the PyTorch nightly releases, and would love to get your feedback on the [PyTorch forums](https://discuss.pytorch.org/c/mobile/18):
34
34
35
-
* Runtime binary size reduction via our [Lite Interpreter](https://pytorch.org/tutorials/prototype/lite_interpreter.html)
36
35
* GPU support on [iOS via Metal](https://pytorch.org/tutorials/prototype/ios_gpu_workflow.html)
37
36
* GPU support on [Android via Vulkan](https://pytorch.org/tutorials/prototype/vulkan_workflow.html)
38
37
* DSP and NPU support on Android via [Google NNAPI](https://pytorch.org/tutorials/prototype/nnapi_mobilenetv2.html)
Since Swift can not talk to C++ directly, we have to either use an Objective-C class as a bridge, or create a C wrapper for the C++ library. For demo purpose, we're going to wrap everything in this Objective-C class.
103
103
@@ -251,7 +251,8 @@ To use the custom built libraries the project, replace `#import <LibTorch/LibTor
PyTorch JIT interpreter is the default interpreter before 1.9 (a version of our PyTorch interpreter that is not as size-efficient). It will still be supported in 1.9, and can be used in CocoaPods:
295
+
```
296
+
pod 'LibTorch', '~>1.9.0'
297
+
```
298
+
292
299
## iOS Tutorials
293
300
294
301
Watch the following [video](https://youtu.be/amTepUIR93k) as PyTorch Partner Engineer Brad Heintz walks through steps for setting up the PyTorch Runtime for iOS projects:
0 commit comments