Skip to content

Commit

Permalink
check api in isnodesupported()
Browse files Browse the repository at this point in the history
  • Loading branch information
daquexian committed Aug 26, 2019
1 parent 52abfa8 commit 2d4b0f0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/onnx2daq/OnnxConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#include <glog/logging.h>
#include <onnx/optimizer/optimize.h>
#include <onnx/shape_inference/implementation.h>
#ifdef __ANDROID__
#include <dnnlibrary/nnapi_implementation.h>
#endif
#include "NodeAttrHelper.h"

using std::string;
Expand Down Expand Up @@ -439,6 +442,11 @@ dnn::optional<Shaper::Shape> GetShape(
std::pair<bool, std::string> 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<std::string> supported_types{
Expand Down

0 comments on commit 2d4b0f0

Please sign in to comment.