From 2d4b0f05bbbb89537eee49d803ec3ea240d6d5db Mon Sep 17 00:00:00 2001 From: daquexian Date: Mon, 26 Aug 2019 11:20:08 +0800 Subject: [PATCH] check api in isnodesupported() --- tools/onnx2daq/OnnxConverter.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/onnx2daq/OnnxConverter.cpp b/tools/onnx2daq/OnnxConverter.cpp index 7e369f5..6e50f41 100644 --- a/tools/onnx2daq/OnnxConverter.cpp +++ b/tools/onnx2daq/OnnxConverter.cpp @@ -11,6 +11,9 @@ #include #include #include +#ifdef __ANDROID__ +#include +#endif #include "NodeAttrHelper.h" using std::string; @@ -439,6 +442,11 @@ dnn::optional GetShape( std::pair OnnxConverter::IsNodeSupported( const ONNX_NAMESPACE::ModelProto &model_proto, const ONNX_NAMESPACE::NodeProto &node) const { +#ifdef __ANDROID__ + if (GetAndroidSdkVersion() < 27) { + return {false, "Android API level is lower than 27"}; + } +#endif NodeAttrHelper helper(node); const auto &op = node.op_type(); const std::vector supported_types{