nn_op_type = -1; // set to invalid
break;
case tflite::BuiltinOperator_CUSTOM:
+ std::string custom_name(registration.custom_name);
+ if (custom_name.compare("TensorFlowMax") == 0)
+ {
+ CHECK_NN(ANeuralNetworksModel_addOperationEx(
+ nn_model, ANEURALNETWORKS_TENSORFLOW_MAX_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;
+ }
+
FATAL("Custom operations are not supported when using NNAPI.");
nn_op_type = -1; // set to invalid
break;
}
}
-#define REGISTER_FUNCTION(Name) \
- TfLiteRegistration *Register_##Name(void) \
- { \
- static TfLiteRegistration r = {::Init##Name, ::Free##Name, ::Prepare##Name, ::Eval##Name}; \
- return &r; \
+#define REGISTER_FUNCTION(Name) \
+ TfLiteRegistration *Register_##Name(void) \
+ { \
+ static TfLiteRegistration r = {::Init##Name, ::Free##Name, ::Prepare##Name, ::Eval##Name, 0, \
+ #Name}; \
+ return &r; \
}
REGISTER_FUNCTION(CAST)
REGISTER_FUNCTION(Stack)