diff --git a/src/operators/fusion_conv_add_relu_op.h b/src/operators/fusion_conv_add_relu_op.h index 1335ce7b6ca5151e3d396856055f38825710f4b1..cde465f266f9eb829794bd295b70dc789f013ee0 100644 --- a/src/operators/fusion_conv_add_relu_op.h +++ b/src/operators/fusion_conv_add_relu_op.h @@ -29,9 +29,8 @@ namespace operators { class FusionConvAddReluOpMatcher : public framework::FusionOpMatcher { public: FusionConvAddReluOpMatcher() { - node_ = framework::Node(G_OP_TYPE_CONV); - node_ > std::make_shared(G_OP_TYPE_ELEMENTWISE_ADD) > - std::make_shared(G_OP_TYPE_RELU); + // node_ = framework::Node(G_OP_TYPE_FUSION_CONV_ADD); + // node_ > std::make_shared(G_OP_TYPE_RELU); } void FolderNodes( diff --git a/src/operators/math/softmax.cpp b/src/operators/math/softmax.cpp index dba88c93969014f2ad0d2636b4141c734dbc2ed5..9c23d99e60f6c7f38f372cbe2d221ae3c1a58592 100644 --- a/src/operators/math/softmax.cpp +++ b/src/operators/math/softmax.cpp @@ -141,13 +141,21 @@ class SoftmaxFuntor { public: void operator()(const framework::Tensor *X, framework::Tensor *Y) { const DDim dDim = X->dims(); + int dim1 = dDim[dDim.size() - 1]; + int dim0 = X->numel() / dim1 / dDim[0]; + framework::DDim matrix_shape = {dim0, dim1}; for (int i = 0; i < dDim[0]; ++i) { framework::Tensor sub_X = X->Slice(i, i + 1); framework::Tensor sub_Y = Y->Slice(i, i + 1); - + sub_X.Resize(matrix_shape); + sub_Y.Resize(matrix_shape); + for (int j = 0; j < dim0; j++) { + framework::Tensor sub_x = sub_X.Slice(j, j + 1); + framework::Tensor sub_y = sub_Y.Slice(j, j + 1); #ifdef __ARM_NEON - SoftmaxCacl(&sub_X, &sub_Y); + SoftmaxCacl(&sub_x, &sub_y); #endif + } } } }; diff --git a/tools/android-debug-script/push2android.sh b/tools/android-debug-script/push2android.sh index fae1a856123bd16cf3f7a115f61b3e4473ff58a3..7183612bd5945635acabdfb7bfbfb0d5a9188cc6 100644 --- a/tools/android-debug-script/push2android.sh +++ b/tools/android-debug-script/push2android.sh @@ -5,9 +5,9 @@ MODELS_PATH="../../test/models/*" MODELS_SRC="../../test/models" IMAGE_PATH="../../test/images/*" EXE_FILE="../../test/build/*" -EXE_DIR="data/local/tmp/bin" +EXE_DIR="/data/local/tmp/bin" adb shell mkdir ${EXE_DIR} -MODELS_DIR="data/local/tmp/models" +MODELS_DIR="/data/local/tmp/models" adb shell mkdir ${MODELS_DIR} for file in `ls ${MODELS_SRC}` do @@ -19,11 +19,15 @@ ACL_BUILD_PATH="../../src/operators/kernel/mali/ACL_Android/build/*" adb push ${ACL_BUILD_PATH} ${EXE_DIR} fi -IMAGES_DIR="data/local/tmp/images" +IMAGES_DIR="/data/local/tmp/images" adb shell mkdir ${IMAGES_DIR} LIB_PATH="../../build/release/arm-v7a/build/*" adb push ${EXE_FILE} ${EXE_DIR} -adb push ${LIB_PATH} ${EXE_DIR} +for file in ${LIB_PATH} +do + adb push ${file} ${EXE_DIR} +done + if [[ $1 != "npm" ]]; then adb push ${IMAGE_PATH} ${IMAGES_DIR} adb push ${MODELS_PATH} ${MODELS_DIR}