mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/39868 ### Summary why disable NNPACK on iOS - To stay consistency with our internal version - It's currently blocking some external users due to its lack support of x86 architecture - https://github.com/pytorch/pytorch/issues/32040 - https://discuss.pytorch.org/t/undefined-symbols-for-architecture-x86-64-for-libtorch-in-swift-unit-test/84552/6 - NNPACK uses fast convolution algorithms (FFT, winograd) to reduce the computational complexity of convolutions with large kernel size. The algorithmic speedup is limited to specific conv params which are unlikely to appear in mobile networks. - Since XNNPACK has been enabled, it performs much better than NNPACK on depthwise-separable convolutions which is the algorithm being used by most of mobile computer vision networks. ### Test Plan - CI Checks Test Plan: Imported from OSS Differential Revision: D22087365 Pulled By: xta0 fbshipit-source-id: 89a959b0736c1f8703eff10723a8fbd02357fd4a |
||
|---|---|---|
| .. | ||
| TestApp | ||
| .gitignore | ||
| LibTorch.h | ||
| LibTorch.podspec | ||
| README.md | ||
PyTorch for iOS
Cocoapods Developers
PyTorch is now available via Cocoapods, to integrate it to your project, simply add the following line to your Podfile and run pod install
pod 'LibTorch'
Import the library
For Objective-C developers, simply import the umbrella header
#import <LibTorch/LibTorch.h>
For Swift developers, you need to create an Objective-C class as a bridge to call the C++ APIs. We highly recommend you to follow the Image Classification demo where you can find out how C++, Objective-C and Swift work together.
Disable Bitcode
Since PyTorch is not yet built with bitcode support, you need to disable bitcode for your target by selecting the Build Settings, searching for Enable Bitcode and set the value to No.
LICENSE
PyTorch is BSD-style licensed, as found in the LICENSE file.