fix bugs in unittest
diff --git a/.github/workflows/macOS.yaml b/.github/workflows/macOS.yaml
index 79e1d2a..795beb6 100644
--- a/.github/workflows/macOS.yaml
+++ b/.github/workflows/macOS.yaml
@@ -31,15 +31,17 @@
with:
python-version: "3.7"
- name: install-build-dependencies
- run: brew install protobuf swig opencv glog lmdb numpy && pip3 install numpy
+ run: brew install protobuf swig opencv glog lmdb numpy && pip3 install numpy \
+ && wget https://github.com/oneapi-src/oneDNN/releases/download/v1.1.3/dnnl_mac_1.1.3_cpu_iomp.tgz -P /tmp && tar zxf /tmp/dnnl_mac_1.1.3_cpu_iomp.tgz -C .
- name: configure
- run: mkdir build && cd build && cmake -DUSE_PYTHON3=YES -DENABLE_TEST=YES ..
+ run: mkdir build && cd build && cmake -DUSE_PYTHON3=YES -DENABLE_TEST=YES -DUSE_DNNL=YES ..
env:
CMAKE_INCLUDE_PATH: /usr/local/opt/openblas/include:$CMAKE_INCLUDE_PATH
CMAKE_LIBRARY_PATH: /usr/local/opt/openblas/lib:$CMAKE_LIBRARY_PATH
+ DNNL_ROOT: `pwd`/dnnl_mac_1.1.3_cpu_iomp
- name: build
run: cd build && make
env:
CXXFLAGS: -I /Users/runner/hostedtoolcache/Python/3.7.8/x64/lib/python3.7/site-packages/numpy/core/include $CXXFLAGS
- name: C++ test
- run: build/bin/test_singa
+ run: build/bin/test_singa
\ No newline at end of file
diff --git a/python/singa/sonnx.py b/python/singa/sonnx.py
index ce4cdc8..fb8197f 100755
--- a/python/singa/sonnx.py
+++ b/python/singa/sonnx.py
@@ -20,7 +20,9 @@
from __future__ import division
import numpy as np
+
import onnx
+import onnx.utils
from onnx.backend.base import Backend, BackendRep
from onnx import (checker, helper, numpy_helper, GraphProto, NodeProto,
TensorProto, OperatorSetIdProto, optimizer, mapping,