Add CUSTOM(Abs) op to nnapi_delegate (#4379)
author장지섭/On-Device Lab(SR)/Engineer/삼성전자 <jiseob.jang@samsung.com>
Thu, 7 Feb 2019 05:46:18 +0000 (14:46 +0900)
committer이춘석/On-Device Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Thu, 7 Feb 2019 05:46:18 +0000 (14:46 +0900)
This commit adds CUSTOM(Abs) op to nnapi_delegate.

Signed-off-by: jiseob.jang <jiseob.jang@samsung.com>
libs/tflite/src/ext/nnapi_delegate.cpp

index 27c9cc4..472b3fb 100644 (file)
@@ -960,6 +960,15 @@ TfLiteStatus AddOpsAndParams(
               reinterpret_cast<uint32_t*>(node.outputs->data)));
           continue;
         }
+        else if (custom_name.compare("Abs") == 0) {
+          CHECK_NN(ANeuralNetworksModel_addOperationEx(
+              nn_model, ANEURALNETWORKS_ABS_EX,
+              static_cast<uint32_t>(augmented_inputs.size()),
+              augmented_inputs.data(),
+              static_cast<uint32_t>(node.outputs->size),
+              reinterpret_cast<uint32_t*>(node.outputs->data)));
+          continue;
+        }
         logError("Custom operations are not supported when using NNAPI.");
         return kTfLiteError;
         break;