diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-08-16 17:21:11 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-08-16 17:26:44 -0700 |
commit | f682a974705f150c407f56a6d8d5df16fa2aed5f (patch) | |
tree | 23c707200e7a3296f8b14cfc2da2519a265f8971 /tensorflow/contrib/lite | |
parent | cbd2411e05fbc4c92d56190043b91ed167b94cd2 (diff) |
Extend external context for Edge TPU
PiperOrigin-RevId: 209077767
Diffstat (limited to 'tensorflow/contrib/lite')
-rw-r--r-- | tensorflow/contrib/lite/context.h | 3 | ||||
-rw-r--r-- | tensorflow/contrib/lite/interpreter.h | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/tensorflow/contrib/lite/context.h b/tensorflow/contrib/lite/context.h index c920f6a508..c265e7ce52 100644 --- a/tensorflow/contrib/lite/context.h +++ b/tensorflow/contrib/lite/context.h @@ -49,7 +49,8 @@ typedef enum { kTfLiteOk = 0, kTfLiteError = 1 } TfLiteStatus; typedef enum { kTfLiteEigenContext = 0, // include eigen_support.h to use. kTfLiteGemmLowpContext = 1, // include gemm_support.h to use. - kTfLiteMaxExternalContexts = 2 + kTfLiteEdgeTpuContext = 2, // Placeholder for Edge TPU support. + kTfLiteMaxExternalContexts = 3 } TfLiteExternalContextType; // An external context is a collection of information unrelated to the TF Lite diff --git a/tensorflow/contrib/lite/interpreter.h b/tensorflow/contrib/lite/interpreter.h index 135732917e..7d69aa2ad3 100644 --- a/tensorflow/contrib/lite/interpreter.h +++ b/tensorflow/contrib/lite/interpreter.h @@ -413,6 +413,10 @@ class Interpreter { return op_reg.profiling_string(&context_, node); } + // Set the value of an external context. + void SetExternalContext(TfLiteExternalContextType type, + TfLiteExternalContext* ctx); + private: friend class InterpreterBuilder; friend class InterpreterTest; @@ -544,8 +548,6 @@ class Interpreter { struct TfLiteContext* context, TfLiteExternalContextType type); // Set the value of an external context. - void SetExternalContext(TfLiteExternalContextType type, - TfLiteExternalContext* ctx); static void SetExternalContext(struct TfLiteContext* context, TfLiteExternalContextType type, TfLiteExternalContext* ctx); |