aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/lite/nnapi_delegate.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-07-23 08:03:04 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-07-23 08:06:09 -0700
commit32fe0302b0cf02d6cc3ae6cf67b233ad65c74bfe (patch)
treedf53fee69a2c7755c5aedb6d9cbdcb06347f9eb1 /tensorflow/contrib/lite/nnapi_delegate.cc
parent8647db865ce41361413a2eb4c3b4d0ba404dd4e0 (diff)
Delegate L2Norm to nnapi.
PiperOrigin-RevId: 205661557
Diffstat (limited to 'tensorflow/contrib/lite/nnapi_delegate.cc')
-rw-r--r--tensorflow/contrib/lite/nnapi_delegate.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/tensorflow/contrib/lite/nnapi_delegate.cc b/tensorflow/contrib/lite/nnapi_delegate.cc
index 710ce1632e..659230e033 100644
--- a/tensorflow/contrib/lite/nnapi_delegate.cc
+++ b/tensorflow/contrib/lite/nnapi_delegate.cc
@@ -560,6 +560,14 @@ TfLiteStatus AddOpsAndParams(
nnapi_version = 11; // require NNAPI 1.1
nn_op_type = ANEURALNETWORKS_TRANSPOSE;
break;
+ case tflite::BuiltinOperator_L2_NORMALIZATION:
+ nn_op_type = ANEURALNETWORKS_L2_NORMALIZATION;
+ if (reinterpret_cast<TfLiteL2NormParams*>(node.builtin_data)
+ ->activation != kTfLiteActNone) {
+ FATAL(
+ "NNAPI does not support L2Normalization with fused activations");
+ }
+ break;
case tflite::BuiltinOperator_CONCAT_EMBEDDINGS:
case tflite::BuiltinOperator_LSH_PROJECTION:
case tflite::BuiltinOperator_HASHTABLE_LOOKUP:
@@ -568,7 +576,6 @@ TfLiteStatus AddOpsAndParams(
case tflite::BuiltinOperator_EMBEDDING_LOOKUP_SPARSE:
case tflite::BuiltinOperator_BIDIRECTIONAL_SEQUENCE_LSTM:
case tflite::BuiltinOperator_UNIDIRECTIONAL_SEQUENCE_LSTM:
- case tflite::BuiltinOperator_L2_NORMALIZATION:
case tflite::BuiltinOperator_LOCAL_RESPONSE_NORMALIZATION:
case tflite::BuiltinOperator_PADV2:
case tflite::BuiltinOperator_RESIZE_BILINEAR: