| @@ -237,13 +237,13 @@ build_lite() { | |||||
| compile_nnie_script=${BASEPATH}/mindspore/lite/tools/providers/NNIE/Hi3516D/compile_nnie.sh | compile_nnie_script=${BASEPATH}/mindspore/lite/tools/providers/NNIE/Hi3516D/compile_nnie.sh | ||||
| cd ${BASEPATH}/../ | cd ${BASEPATH}/../ | ||||
| if [[ "${local_lite_platform}" == "x86_64" ]]; then | if [[ "${local_lite_platform}" == "x86_64" ]]; then | ||||
| sh ${compile_nnie_script} -I x86_64 -b nnie_3516_master_dev_2 -j $THREAD_NUM | |||||
| sh ${compile_nnie_script} -I x86_64 -b nnie_3516_master -j $THREAD_NUM | |||||
| if [[ $? -ne 0 ]]; then | if [[ $? -ne 0 ]]; then | ||||
| echo "compile x86_64 for nnie failed." | echo "compile x86_64 for nnie failed." | ||||
| exit 1 | exit 1 | ||||
| fi | fi | ||||
| elif [[ "${local_lite_platform}" == "arm32" ]]; then | elif [[ "${local_lite_platform}" == "arm32" ]]; then | ||||
| sh ${compile_nnie_script} -I arm32 -b nnie_3516_master_dev -j $THREAD_NUM | |||||
| sh ${compile_nnie_script} -I arm32 -b nnie_3516_master -j $THREAD_NUM | |||||
| if [[ $? -ne 0 ]]; then | if [[ $? -ne 0 ]]; then | ||||
| echo "compile arm32 for nnie failed." | echo "compile arm32 for nnie failed." | ||||
| exit 1 | exit 1 | ||||
| @@ -16,19 +16,5 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/third_party) | |||||
| include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/third_party/eigen3) | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/third_party/eigen3) | ||||
| include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/third_party/securec) | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/third_party/securec) | ||||
| # Add directory to linker search path | |||||
| link_directories(${CMAKE_CURRENT_SOURCE_DIR}/lib) | |||||
| file(GLOB_RECURSE CONVERTER_REGISTRY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc) | file(GLOB_RECURSE CONVERTER_REGISTRY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc) | ||||
| add_library(converter_extend_tutorial SHARED ${CONVERTER_REGISTRY_SRC}) | add_library(converter_extend_tutorial SHARED ${CONVERTER_REGISTRY_SRC}) | ||||
| target_link_libraries(converter_extend_tutorial | |||||
| mslite_converter_plugin | |||||
| -Wl,--whole-archive mindspore_core -Wl,--no-whole-archive | |||||
| mindspore_gvar | |||||
| crypto | |||||
| securec | |||||
| glog | |||||
| protobuf | |||||
| dl | |||||
| ) | |||||
| @@ -100,6 +100,7 @@ if(MSLITE_ENABLE_CONVERTER) | |||||
| ${TEST_DIR}/common/import_from_meta_graphT.cc | ${TEST_DIR}/common/import_from_meta_graphT.cc | ||||
| ${LITE_DIR}/src/ops/ops_utils.cc | ${LITE_DIR}/src/ops/ops_utils.cc | ||||
| ${LITE_DIR}/src/ops/ops_def.cc | ${LITE_DIR}/src/ops/ops_def.cc | ||||
| ${LITE_DIR}/src/tensor.cc | |||||
| ) | ) | ||||
| endif() | endif() | ||||
| @@ -14,7 +14,8 @@ set(CCSRC_SRC | |||||
| include_directories(${TOP_DIR}/mindspore/ccsrc/backend/kernel_compiler/cpu) | include_directories(${TOP_DIR}/mindspore/ccsrc/backend/kernel_compiler/cpu) | ||||
| if(NOT WIN32) | if(NOT WIN32) | ||||
| set(CMAKE_EXE_LINKER_FLAGS "-rdynamic") | |||||
| set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -rdynamic -fvisibility=hidden") | |||||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic -fvisibility=hidden") | |||||
| endif() | endif() | ||||
| file(GLOB_RECURSE CONVERTER_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} | file(GLOB_RECURSE CONVERTER_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} | ||||
| @@ -40,16 +40,14 @@ ops::PrimitiveC *OnnxExpandParser::Parse(const onnx::GraphProto &onnx_graph, con | |||||
| auto node_iter = | auto node_iter = | ||||
| std::find_if(onnx_graph.node().begin(), onnx_graph.node().end(), | std::find_if(onnx_graph.node().begin(), onnx_graph.node().end(), | ||||
| [onnx_expand_power](const onnx::NodeProto &proto) { return proto.output(0) == onnx_expand_power; }); | [onnx_expand_power](const onnx::NodeProto &proto) { return proto.output(0) == onnx_expand_power; }); | ||||
| if (node_iter == onnx_graph.node().end()) { | |||||
| MS_LOG(ERROR) << "can not find node: " << onnx_expand_power; | |||||
| return nullptr; | |||||
| } | |||||
| for (const auto &attr_power : node_iter->attribute()) { | |||||
| if (attr_power.name() == "value") { | |||||
| const auto &t = attr_power.t(); | |||||
| auto *data_ptr = reinterpret_cast<const int64_t *>(t.raw_data().data()); | |||||
| for (int i = 0; i < t.dims(0); ++i) { | |||||
| dst_shape.emplace_back(data_ptr[i]); | |||||
| if (node_iter != onnx_graph.node().end()) { | |||||
| for (const auto &attr_power : node_iter->attribute()) { | |||||
| if (attr_power.name() == "value") { | |||||
| const auto &t = attr_power.t(); | |||||
| auto *data_ptr = reinterpret_cast<const int64_t *>(t.raw_data().data()); | |||||
| for (int i = 0; i < t.dims(0); ++i) { | |||||
| dst_shape.emplace_back(data_ptr[i]); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||