Summary of PyTorch Mobile Recipes¶
This summary provides a top level overview of recipes for PyTorch Mobile to help developers choose which recipes to follow for their PyTorch-powered mobile app development.
When a PyTorch model is trained or retrained, or when a pre-trained model is available, for mobile deployment, follow the the recipes outlined in this summary so mobile apps can successfully use the model.
PyTorch 1.6.0 or 1.7.0
(Optional) torchvision 0.6.0 or 0.7.0
For iOS development: Xcode 11 or 12
For Android development: Android Studio 3.5.1 or above (with NDK installed); or Android SDK, NDK, Gradle, JDK.
New Recipes for PyTorch Mobile¶
- (Recommended) To fuse a list of PyTorch modules into a single module to reduce the model size before quantization, read the Fuse Modules recipe.
- (Recommended) To reduce the model size and make it run faster without losing much on accuracy, read the Quantization Recipe.
- (Must) To convert the model to TorchScipt and (optional) optimize it for mobile apps, read the Script and Optimize for Mobile Recipe.
- (Must for iOS development) To add the model in an iOS project and use PyTorch pod for iOS, read the Model preparation for iOS Recipe.
- (Must for Android development) To add the model in an Android project and use the PyTorch library for Android, read the Model preparation for Android Recipe.