Cleanup TFLITE_USE_CONTRIB_LITE flag in iOS examples

PiperOrigin-RevId: 241831903
This commit is contained in:
Yu-Cheng Ling 2019-04-03 16:43:00 -07:00 committed by TensorFlower Gardener
parent 4c254c42cb
commit 7bbe0761d4
2 changed files with 2 additions and 26 deletions

View File

@ -17,27 +17,11 @@
#include <vector>
// TensorFlow Lite was migrated out of `contrib/` directory. The change
// wasn't reflected in newest CocoaPod release yet (1.12.0).
// Change this to 0 when using a TFLite version which is newer than 1.12.0.
// TODO(ycling): Remove the macro when we release the next version.
#ifndef TFLITE_USE_CONTRIB_LITE
#define TFLITE_USE_CONTRIB_LITE 1
#endif
// Set TFLITE_USE_GPU_DELEGATE to 1 to use TFLite GPU Delegate.
// Note: TFLite GPU Delegate binary isn't releast yet, and we're working
// on it.
#ifndef TFLITE_USE_GPU_DELEGATE
#define TFLITE_USE_GPU_DELEGATE 0
#endif
#if TFLITE_USE_GPU_DELEGATE && TFLITE_USE_CONTRIB_LITE
// Sanity check.
#error "GPU Delegate only works with newer TFLite " \
"after migrating out of contrib"
#endif
@interface CameraExampleViewController
: UIViewController<UIGestureRecognizerDelegate, AVCaptureVideoDataOutputSampleBufferDelegate> {
IBOutlet UIView* previewView;

View File

@ -85,16 +85,8 @@ target 'YourProjectName'
#### Step 3. Enable the GPU Delegate
You will need to change two `#define` flags in `CameraExampleViewController.h`
to enable the GPU delegate. First, change `TFLITE_USE_CONTRIB_LITE` from 1 to 0
since TensorFlow Lite has moved from TensorFlow contrib into core.
```c
#define TFLITE_USE_CONTRIB_LITE 0
```
Next, change `TFLITE_USE_GPU_DELEGATE` from 0 to 1, to enable the code that will
use the GPU delegate.
To enable the code that will use the GPU delegate, you will need to change
`TFLITE_USE_GPU_DELEGATE` from 0 to 1 in `CameraExampleViewController.h`.
```c
#define TFLITE_USE_GPU_DELEGATE 1