Update TFLite iOS delegate docs with CocoaPods change

PiperOrigin-RevId: 314693084
Change-Id: I2603cc6e735de48029fa240c45a1d67d9444facd
This commit is contained in:
Taehee Jeong 2020-06-04 02:26:33 -07:00 committed by TensorFlower Gardener
parent c72cc5c449
commit a8ab56eb94
3 changed files with 50 additions and 4 deletions
tensorflow/lite/g3doc

View File

@ -68,7 +68,17 @@ pod is used in your app. Alternatively, if you want to depend on the nightly
builds, you can write:
```ruby
pod 'TensorFlowLiteSwift', '0.0.1-nightly'
pod 'TensorFlowLiteSwift', '~> 0.0.1-nightly'
```
For nightly version, by default
[GPU](https://www.tensorflow.org/lite/performance/gpu) and
[Core ML delegates](https://www.tensorflow.org/lite/performance/coreml_delegate)
are excluded from the pod to reduce the binary size. You can include them by
specifying subspec:
```ruby
pod 'TensorFlowLiteSwift', '~> 0.0.1-nightly', :subspecs => ['CoreML', 'Metal']
```
This will allow you to use the latest features added to TensorFlow Lite. Note

View File

@ -25,13 +25,21 @@ The Core ML delegate currently supports float32 models.
The Core ML delegate is already included in nightly release of TensorFlow lite
CocoaPods. To use Core ML delegate, change your TensorFlow lite pod
(`TensorflowLiteC` for C++ API, and `TensorFlowLiteSwift` for Swift) version to
`0.0.1-nightly` in your `Podfile`.
(`TensorflowLiteC` for C API, and `TensorFlowLiteSwift` for Swift) version to
`0.0.1-nightly` in your `Podfile`, and include subspec `CoreML`
```
target 'YourProjectName'
# pod 'TensorFlowLiteSwift'
pod 'TensorFlowLiteSwift', '~> 0.0.1-nightly'
pod 'TensorFlowLiteSwift/CoreML', '~> 0.0.1-nightly'
```
OR
```
target 'YourProjectName'
# pod 'TensorFlowLiteSwift'
pod 'TensorFlowLiteSwift', '~> 0.0.1-nightly', :subspecs => ['CoreML']
```
Note: After updating `Podfile`, you should run `pod update` to reflect changes.

View File

@ -76,6 +76,10 @@ on your phone.
#### Step 2. Modify the Podfile to use the TensorFlow Lite GPU CocoaPod
<section class="zippy">
Until TensorFlow Lite 2.0.0
We have built a binary CocoaPod that includes the GPU delegate. To switch the
project to use it, modify the
`tensorflow/tensorflow/lite/examples/ios/camera/Podfile` file to use
@ -87,6 +91,30 @@ target 'YourProjectName'
pod 'TensorFlowLiteGpuExperimental'
```
</section>
From TensorFlow Lite 2.1.0, GPU delegate is inlcuded in the `TensorFlowLiteC`
pod. You can choose between `TensorFlowLiteC` and `TensorFlowLiteSwift`
depending on the language.
Note: This behavior will be changed in 2.3.0 and latest nightly releases
For nightly version and upcoming 2.3.0 release, by default GPU delegate is
excluded from the pod to reduce the binary size. You can include them by
specifying subspec. For `TensorFlowLiteSwift` pod:
```ruby
pod 'TensorFlowLiteSwift/Metal', '~> 0.0.1-nightly',
```
OR
```ruby
pod 'TensorFlowLiteSwift', '~> 0.0.1-nightly', :subspecs => ['Metal']
```
You can do similiarly for `TensorFlowLiteC` if you want to use the C API.
#### Step 3. Enable the GPU delegate
To enable the code that will use the GPU delegate, you will need to change