diff --git a/build.sh b/build.sh index 4ebcad069c8..31155e6bfc6 100755 --- a/build.sh +++ b/build.sh @@ -566,7 +566,7 @@ build_lite() else mkdir -pv ${BASEPATH}/mindspore/lite/output/ if [[ "$LITE_PLATFORM" == "x86_64" ]]; then - OUTPUT_DIR=${BASEPATH}/mindspore/lite/output/MSLite-0.5.0-linux_x86_64 + OUTPUT_DIR=${BASEPATH}/output/MSLite-0.5.0-linux_x86_64 rm -rf ${OUTPUT_DIR} && mkdir -p ${OUTPUT_DIR} && cd ${OUTPUT_DIR} mkdir -p ${OUTPUT_DIR}/converter && mkdir -p ${OUTPUT_DIR}/time_profile mkdir -p ${OUTPUT_DIR}/benchmark && mkdir -p ${OUTPUT_DIR}/include && mkdir -p ${OUTPUT_DIR}/lib @@ -587,6 +587,8 @@ build_lite() cp -r ${BASEPATH}/third_party/flatbuffers/include/ ${OUTPUT_DIR}/third_party/flatbuffers/ cd .. tar -cf MSLite-0.5.0-linux_x86_64.tar.gz MSLite-0.5.0-linux_x86_64/ --warning=no-file-changed + sha256sum MSLite-0.5.0-linux_x86_64.tar.gz > MSLite-0.5.0-linux_x86_64.tar.gz.256sha + rm -rf MSLite-0.5.0-linux_x86_64/ elif [[ "$LITE_PLATFORM" == "arm64" ]]; then OUTPUT_DIR=${BASEPATH}/mindspore/lite/output/MSLite-0.5.0-linux_arm64 rm -rf ${OUTPUT_DIR} && mkdir -p ${OUTPUT_DIR} && cd ${OUTPUT_DIR} @@ -604,6 +606,8 @@ build_lite() cp -r ${BASEPATH}/third_party/flatbuffers/include/ ${OUTPUT_DIR}/third_party/flatbuffers/ cd .. tar -cf MSLite-0.5.0-linux_arm64.tar.gz MSLite-0.5.0-linux_arm64/ --warning=no-file-changed + sha256sum MSLite-0.5.0-linux_arm64.tar.gz > MSLite-0.5.0-linux_arm64.tar.gz.256sha + rm -rf MSLite-0.5.0-linux_arm64/ elif [[ "$LITE_PLATFORM" == "arm32" ]]; then OUTPUT_DIR=${BASEPATH}/mindspore/lite/output/MSLite-0.5.0-linux_arm32 rm -rf ${OUTPUT_DIR} && mkdir -p ${OUTPUT_DIR} && cd ${OUTPUT_DIR} @@ -621,6 +625,8 @@ build_lite() cp -r ${BASEPATH}/third_party/flatbuffers/include/ ${OUTPUT_DIR}/third_party/flatbuffers/ cd .. tar -cf MSLite-0.5.0-linux_arm32.tar.gz MSLite-0.5.0-linux_arm32/ --warning=no-file-changed + sha256sum MSLite-0.5.0-linux_arm32.tar.gz > MSLite-0.5.0-linux_arm32.tar.gz.256sha + rm -rf MSLite-0.5.0-linux_arm32/ fi echo "---------------- mindspore lite: build success ----------------" fi diff --git a/mindspore/lite/CMakeLists.txt b/mindspore/lite/CMakeLists.txt index fd70ace0fe1..f35b5b60c14 100644 --- a/mindspore/lite/CMakeLists.txt +++ b/mindspore/lite/CMakeLists.txt @@ -17,6 +17,7 @@ include_directories(${TOP_DIR}/third_party) include_directories(${TOP_DIR}/third_party/flatbuffers/include) include(${TOP_DIR}/cmake/utils.cmake) +include(${TOP_DIR}/cmake/dependency_utils.cmake) include(${TOP_DIR}/cmake/external_libs/json.cmake) include(${TOP_DIR}/cmake/dependency_securec.cmake) set(CMAKE_VERBOSE_MAKEFILE on) diff --git a/mindspore/lite/build.sh b/mindspore/lite/build.sh deleted file mode 100755 index 15243f98c98..00000000000 --- a/mindspore/lite/build.sh +++ /dev/null @@ -1,272 +0,0 @@ -#!/usr/bin/env bash - -set -e - -CUR_DIR=$(cd "$(dirname $0)"; pwd) -BASE_DIR=${CUR_DIR}/../../ - -usage() -{ - echo "Usage:" - echo "bash build.sh [-d] [-a arm64|arm32] [-j[n]] [-m] [-f] [-g] [-c] [-s] [-o]" - echo "" - echo "Options:" - echo " -d Enable Debug" - echo " -c Enable compile converter, default off" - echo " -m Enable Incremental compilation" - echo " -a Select ARM platform, default off" - echo " -j[n] Set the threads when building, default: -j8" - echo " -f Compile fp16 ops" - echo " -g Enable gpu compile" - echo " -s Support train" - echo " -o Offline compile OpenCL kernel" -} - -checkopts() -{ - # Init default values of build options - THREAD_NUM="8" - BUILD_TYPE="Release" - BUILD_DEVICE_PLATFORM="off" - MAKE_ONLY="off" - ENABLE_FP16="off" - ENABLE_GPU="off" - ENABLE_CONVERTER="off" - SUPPORT_TRAIN="off" - OFFLINE_COMPILE="off" - - # Process the options - while getopts 'j:da:mfcsgo' opt - do - OPTARG=$(echo ${OPTARG} | tr '[A-Z]' '[a-z]') - case "${opt}" in - m) - MAKE_ONLY="on" - echo "Incremental compilation" - ;; - d) - BUILD_TYPE="Debug" - echo "Build Debug version" - ;; - j) - THREAD_NUM=$OPTARG - ;; - a) - if [[ "X$OPTARG" == "Xarm64" ]]; then - BUILD_DEVICE_PLATFORM="arm64" - echo "Enable arm64" - elif [[ "X$OPTARG" == "Xarm32" ]]; then - BUILD_DEVICE_PLATFORM="arm32" - echo "Enable arm32" - else - echo "-I parameter must be arm64 or arm32" - exit 1 - fi - ;; - c) - ENABLE_CONVERTER="on" - echo "Enable converter" - ;; - s) - SUPPORT_TRAIN="on" - echo "Support train" - ;; - f) - ENABLE_FP16="on" - echo "Enable fp16" - ;; - g) - ENABLE_GPU="on" - echo "Enable gpu" - ;; - o) - OFFLINE_COMPILE="on" - echo "OpenCL kernel offline compile" - ;; - *) - echo "Unknown option ${opt}!" - usage - exit 1 - esac - done -} - -checkndk() { - if [ "${ANDROID_NDK}" ]; then - echo -e "\e[31mANDROID_NDK_PATH=$ANDROID_NDK \e[0m" - else - echo -e "\e[31mplease set ANDROID_NDK_PATH in environment variable for example: export ANDROID_NDK=/root/usr/android-ndk-r16b/ \e[0m" - exit 1 - fi -} - -gene_flatbuffer() { - FLAT_DIR="${BASE_DIR}/mindspore/lite/schema" - cd ${FLAT_DIR} && rm -rf "${FLAT_DIR}/inner" && mkdir -p "${FLAT_DIR}/inner" - find . -name "*.fbs" -print0 | xargs -0 "${FLATC}" -c -b - find . -name "*.fbs" -print0 | xargs -0 "${FLATC}" -c -b --reflect-types --gen-mutable --reflect-names --gen-object-api -o "${FLAT_DIR}/inner" - - FLAT_DIR="${BASE_DIR}/mindspore/lite/tools/converter/parser/tflite" - cd ${FLAT_DIR} - find . -name "*.fbs" -print0 | xargs -0 "${FLATC}" -c -b --reflect-types --gen-mutable --reflect-names --gen-object-api -o "${FLAT_DIR}/" -} - -build_flatbuffer() { - cd ${BASE_DIR} - FLATC="${BASE_DIR}"/third_party/flatbuffers/build/flatc - if [[ ! -f "${FLATC}" ]]; then - git submodule update --init --recursive third_party/flatbuffers - cd ${BASE_DIR}/third_party/flatbuffers - rm -rf build && mkdir -pv build && cd build && cmake .. && make -j$THREAD_NUM - gene_flatbuffer - fi - if [[ "${MAKE_ONLY}" == "off" ]]; then - gene_flatbuffer - fi -} - -gene_protobuf() { - PROTO_SRC_DIR="${BASE_DIR}/mindspore/lite/tools/converter/parser/caffe" - find ${PROTO_SRC_DIR} -name "*.proto" -print0 | xargs -0 "${PROTOC}" -I"${PROTO_SRC_DIR}" --cpp_out="${PROTO_SRC_DIR}" - PROTO_SRC_DIR="${BASE_DIR}/mindspore/lite/tools/converter/parser/onnx" - find ${PROTO_SRC_DIR} -name "*.proto" -print0 | xargs -0 "${PROTOC}" -I"${PROTO_SRC_DIR}" --cpp_out="${PROTO_SRC_DIR}" -} - -build_protobuf() { - cd ${BASE_DIR} - PROTOC="${BASE_DIR}"/third_party/protobuf/build/bin/protoc - if [[ ! -f "${PROTOC}" ]]; then - git submodule update --init --recursive third_party/protobuf - cd ${BASE_DIR}/third_party/protobuf - rm -rf build && mkdir -pv build && ./autogen.sh - ./configure --prefix=${BASE_DIR}/third_party/protobuf/build - make clean && make -j$THREAD_NUM && make install - gene_protobuf - fi - if [[ "${MAKE_ONLY}" == "off" ]]; then - gene_protobuf - fi -} - -build_gtest() { - cd ${BASE_DIR} - git submodule update --init --recursive third_party/googletest -} - -gene_clhpp() { - CL_SRC_DIR="${BASE_DIR}/mindspore/lite/src/runtime/kernel/opencl/cl" - for sub_dir in "${CL_SRC_DIR}"/* - do - data_type="$(basename ${sub_dir})" - if [ ! -d ${CL_SRC_DIR}/${data_type} ]; then - continue - fi - cd ${CL_SRC_DIR}/${data_type} - rm -rf *.inc - echo "$(cd "$(dirname $0)"; pwd)" - for file_path in "${CL_SRC_DIR}/${data_type}"/* - do - file="$(basename ${file_path})" - inc_file=`echo ${CL_SRC_DIR}/${data_type}/${file} | sed 's/$/.inc/'` - sed 's/^/\"/;s/$/ \\n\" \\/' ${CL_SRC_DIR}/${data_type}/${file} > ${inc_file} - kernel_name=`echo ${file} | sed s'/.\{3\}$//'` - sed -i "1i\static const char *${kernel_name}_source_${data_type} =\"\\n\" \\" ${inc_file} - sed -i '$a\;' ${inc_file} - done - done -} - -gene_ocl_program() { - CL_SRC_DIR="${BASE_DIR}/mindspore/lite/src/runtime/kernel/opencl/cl" - SPIRV_DIR=build/spirv - rm -rf ${SPIRV_DIR} - mkdir -pv ${SPIRV_DIR} - for sub_dir in "${CL_SRC_DIR}"/* - do - data_type="$(basename ${sub_dir})" - if [ ! -d ${CL_SRC_DIR}/${data_type} ]; then - continue - fi - #echo $(cd "$(dirname $0)"; pwd) - for file_path in "${CL_SRC_DIR}/${data_type}"/* - do - file="$(basename ${file_path})" - if [ "${file##*.}" != "cl" ]; then - continue - fi - clang -Xclang -finclude-default-header -cl-std=CL2.0 --target=spir64-unknown-unknown -emit-llvm \ - -c -O0 -o ${SPIRV_DIR}/${file%.*}.bc ${CL_SRC_DIR}/${data_type}/${file} - done - done - - bcs=`ls ${SPIRV_DIR}/*.bc` - llvm-link ${bcs} -o ${SPIRV_DIR}/program.bc - llvm-spirv -o ${SPIRV_DIR}/program.spv ${SPIRV_DIR}/program.bc - - CL_PROGRAM_PATH="${BASE_DIR}/mindspore/lite/src/runtime/kernel/opencl/cl/program.inc" - echo "#include " > ${CL_PROGRAM_PATH} - echo "std::vector g_program_binary = {" >> ${CL_PROGRAM_PATH} - #hexdump -v -e '16/1 "0x%02x, " "\n"' ${SPIRV_DIR}/program.spv >> ${CL_PROGRAM_PATH} - hexdump -v -e '1/1 "0x%02x, "' ${SPIRV_DIR}/program.spv >> ${CL_PROGRAM_PATH} - echo "};" >> ${CL_PROGRAM_PATH} - echo "Compile SPIRV done" -} - -build_opencl() { - cd ${BASE_DIR} - git submodule update --init third_party/OpenCL-Headers - git submodule update --init third_party/OpenCL-CLHPP - if [[ "${OFFLINE_COMPILE}" == "on" ]]; then - gene_ocl_program - else - gene_clhpp - fi -} - -buildlite() { - if [[ "${MAKE_ONLY}" == "off" ]]; then - cd ${CUR_DIR} - rm -rf build - mkdir -pv build - cd build - if [[ "${BUILD_DEVICE_PLATFORM}" == "arm64" ]]; then - checkndk - cmake -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" -DANDROID_NATIVE_API_LEVEL="19" \ - -DANDROID_NDK="${ANDROID_NDK}" -DANDROID_ABI="arm64-v8a" -DANDROID_TOOLCHAIN_NAME="aarch64-linux-android-clang" \ - -DANDROID_STL="c++_shared" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSUPPORT_TRAIN=${SUPPORT_TRAIN} \ - -DBUILD_DEVICE=on -DPLATFORM_ARM64=on -DBUILD_CONVERTER=off -DENABLE_NEON=on -DENABLE_FP16="${ENABLE_FP16}" \ - -DSUPPORT_GPU=${ENABLE_GPU} -DOFFLINE_COMPILE=${OFFLINE_COMPILE} .. - elif [[ "${BUILD_DEVICE_PLATFORM}" == "arm32" ]]; then - checkndk - cmake -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" -DANDROID_NATIVE_API_LEVEL="19" \ - -DANDROID_NDK="${ANDROID_NDK}" -DANDROID_ABI="armeabi-v7a" -DANDROID_TOOLCHAIN_NAME="clang" \ - -DANDROID_STL="c++_shared" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -DBUILD_DEVICE=on -DPLATFORM_ARM32=on -DENABLE_NEON=on -DSUPPORT_TRAIN=${SUPPORT_TRAIN} -DBUILD_CONVERTER=off \ - -DSUPPORT_GPU=${ENABLE_GPU} -DOFFLINE_COMPILE=${OFFLINE_COMPILE} .. - else - cmake -DBUILD_DEVICE=on -DPLATFORM_ARM64=off -DBUILD_CONVERTER=${ENABLE_CONVERTER} -DSUPPORT_TRAIN=${SUPPORT_TRAIN} \ - -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSUPPORT_GPU=${ENABLE_GPU} -DOFFLINE_COMPILE=${OFFLINE_COMPILE} .. - fi - else - cd ${CUR_DIR}/build - fi - VERBOSE=2 make -j$THREAD_NUM -} - -echo "---------------- mindspore lite: build start ----------------" -checkopts "$@" -build_flatbuffer -if [[ "${ENABLE_CONVERTER}" == "on" ]]; then - build_protobuf -fi -if [[ "${ENABLE_GPU}" == "on" ]]; then - build_opencl -fi -build_gtest -buildlite -COMPILE_RET=$? -if [[ "${COMPILE_RET}" -ne 0 ]]; then - echo "---------------- mindspore lite: build failed ----------------" -else - echo "---------------- mindspore lite: build success ----------------" -fi diff --git a/mindspore/lite/cmake-build-cloud/Lite.cbp b/mindspore/lite/cmake-build-cloud/Lite.cbp deleted file mode 100644 index c33b0880ed1..00000000000 --- a/mindspore/lite/cmake-build-cloud/Lite.cbp +++ /dev/null @@ -1,4235 +0,0 @@ - - - - - - diff --git a/mindspore/lite/cmake-build-cloud/googletest/CTestTestfile.cmake b/mindspore/lite/cmake-build-cloud/googletest/CTestTestfile.cmake deleted file mode 100644 index 08108fdcf45..00000000000 --- a/mindspore/lite/cmake-build-cloud/googletest/CTestTestfile.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# CMake generated Testfile for -# Source directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/third_party/googletest -# Build directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-cloud/googletest -# -# This file includes the relevant testing commands required for -# testing this directory and lists subdirectories to be tested as well. -subdirs("googlemock") diff --git a/mindspore/lite/cmake-build-cloud/googletest/googlemock/CTestTestfile.cmake b/mindspore/lite/cmake-build-cloud/googletest/googlemock/CTestTestfile.cmake deleted file mode 100644 index 4b7b83c2412..00000000000 --- a/mindspore/lite/cmake-build-cloud/googletest/googlemock/CTestTestfile.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# CMake generated Testfile for -# Source directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/third_party/googletest/googlemock -# Build directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-cloud/googletest/googlemock -# -# This file includes the relevant testing commands required for -# testing this directory and lists subdirectories to be tested as well. -subdirs("gtest") diff --git a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gmock.cbp b/mindspore/lite/cmake-build-cloud/googletest/googlemock/gmock.cbp deleted file mode 100644 index d4b5f94e6fd..00000000000 --- a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gmock.cbp +++ /dev/null @@ -1,517 +0,0 @@ - - - - - - diff --git a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/CTestTestfile.cmake b/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/CTestTestfile.cmake deleted file mode 100644 index fe5ea99621e..00000000000 --- a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/CTestTestfile.cmake +++ /dev/null @@ -1,6 +0,0 @@ -# CMake generated Testfile for -# Source directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/third_party/googletest/googletest -# Build directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest -# -# This file includes the relevant testing commands required for -# testing this directory and lists subdirectories to be tested as well. diff --git a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/GTestConfig.cmake b/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/GTestConfig.cmake deleted file mode 100644 index 0ee9ec8f9f5..00000000000 --- a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/GTestConfig.cmake +++ /dev/null @@ -1,33 +0,0 @@ - -####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### -####### Any changes to this file will be overwritten by the next CMake run #### -####### The input file was Config.cmake.in ######## - -get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) - -macro(set_and_check _var _file) - set(${_var} "${_file}") - if(NOT EXISTS "${_file}") - message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") - endif() -endmacro() - -macro(check_required_components _NAME) - foreach(comp ${${_NAME}_FIND_COMPONENTS}) - if(NOT ${_NAME}_${comp}_FOUND) - if(${_NAME}_FIND_REQUIRED_${comp}) - set(${_NAME}_FOUND FALSE) - endif() - endif() - endforeach() -endmacro() - -#################################################################################### -include(CMakeFindDependencyMacro) -if (ON) - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_dependency(Threads) -endif() - -include("${CMAKE_CURRENT_LIST_DIR}/GTestTargets.cmake") -check_required_components("") diff --git a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/GTestConfigVersion.cmake b/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/GTestConfigVersion.cmake deleted file mode 100644 index b12397d6586..00000000000 --- a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/GTestConfigVersion.cmake +++ /dev/null @@ -1,37 +0,0 @@ -# This is a basic version file for the Config-mode of find_package(). -# It is used by write_basic_package_version_file() as input file for configure_file() -# to create a version-file which can be installed along a config.cmake file. -# -# The created file sets PACKAGE_VERSION_EXACT if the current version string and -# the requested version string are exactly the same and it sets -# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version. -# The variable CVF_VERSION must be set before calling configure_file(). - -set(PACKAGE_VERSION "1.9.0") - -if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) - set(PACKAGE_VERSION_COMPATIBLE FALSE) -else() - set(PACKAGE_VERSION_COMPATIBLE TRUE) - if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) - set(PACKAGE_VERSION_EXACT TRUE) - endif() -endif() - - -# if the installed project requested no architecture check, don't perform the check -if("FALSE") - return() -endif() - -# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") - return() -endif() - -# check that the installed version has the same 32/64bit-ness as the one which is currently searching: -if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") - math(EXPR installedBits "8 * 8") - set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") - set(PACKAGE_VERSION_UNSUITABLE TRUE) -endif() diff --git a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/gmock.pc b/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/gmock.pc deleted file mode 100644 index d4242cfa66f..00000000000 --- a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/gmock.pc +++ /dev/null @@ -1,9 +0,0 @@ -libdir=/usr/local/lib -includedir=/usr/local/include - -Name: gmock -Description: GoogleMock (without main() function) -Version: 1.9.0 -URL: https://github.com/google/googletest -Libs: -L${libdir} -lgmock -pthread -Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread diff --git a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/gmock_main.pc b/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/gmock_main.pc deleted file mode 100644 index 2da4fbcc017..00000000000 --- a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/gmock_main.pc +++ /dev/null @@ -1,9 +0,0 @@ -libdir=/usr/local/lib -includedir=/usr/local/include - -Name: gmock_main -Description: GoogleMock (with main() function) -Version: 1.9.0 -URL: https://github.com/google/googletest -Libs: -L${libdir} -lgmock_main -pthread -Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread diff --git a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/gtest.pc b/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/gtest.pc deleted file mode 100644 index a9931b8be97..00000000000 --- a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/gtest.pc +++ /dev/null @@ -1,9 +0,0 @@ -libdir=/usr/local/lib -includedir=/usr/local/include - -Name: gtest -Description: GoogleTest (without main() function) -Version: 1.9.0 -URL: https://github.com/google/googletest -Libs: -L${libdir} -lgtest -pthread -Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread diff --git a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/gtest_main.pc b/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/gtest_main.pc deleted file mode 100644 index 57948c76ee1..00000000000 --- a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/generated/gtest_main.pc +++ /dev/null @@ -1,10 +0,0 @@ -libdir=/usr/local/lib -includedir=/usr/local/include - -Name: gtest_main -Description: GoogleTest (with main() function) -Version: 1.9.0 -URL: https://github.com/google/googletest -Requires: gtest -Libs: -L${libdir} -lgtest_main -pthread -Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread diff --git a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/gtest.cbp b/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/gtest.cbp deleted file mode 100644 index df1d2d30c9d..00000000000 --- a/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest/gtest.cbp +++ /dev/null @@ -1,327 +0,0 @@ - - - - - - diff --git a/mindspore/lite/cmake-build-cloud/googletest/googletest-distribution.cbp b/mindspore/lite/cmake-build-cloud/googletest/googletest-distribution.cbp deleted file mode 100644 index 933a58b2371..00000000000 --- a/mindspore/lite/cmake-build-cloud/googletest/googletest-distribution.cbp +++ /dev/null @@ -1,517 +0,0 @@ - - - - - - diff --git a/mindspore/lite/cmake-build-cloud/src/runtime/kernel/arm/opclib/optimize.cbp b/mindspore/lite/cmake-build-cloud/src/runtime/kernel/arm/opclib/optimize.cbp deleted file mode 100644 index 2e3dd81d819..00000000000 --- a/mindspore/lite/cmake-build-cloud/src/runtime/kernel/arm/opclib/optimize.cbp +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - diff --git a/mindspore/lite/cmake-build-minnie/Lite.cbp b/mindspore/lite/cmake-build-minnie/Lite.cbp deleted file mode 100644 index 686f7908508..00000000000 --- a/mindspore/lite/cmake-build-minnie/Lite.cbp +++ /dev/null @@ -1,4235 +0,0 @@ - - - - - - diff --git a/mindspore/lite/cmake-build-minnie/googletest/CTestTestfile.cmake b/mindspore/lite/cmake-build-minnie/googletest/CTestTestfile.cmake deleted file mode 100644 index 356aeec8f07..00000000000 --- a/mindspore/lite/cmake-build-minnie/googletest/CTestTestfile.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# CMake generated Testfile for -# Source directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/third_party/googletest -# Build directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-minnie/googletest -# -# This file includes the relevant testing commands required for -# testing this directory and lists subdirectories to be tested as well. -subdirs("googlemock") diff --git a/mindspore/lite/cmake-build-minnie/googletest/googlemock/CTestTestfile.cmake b/mindspore/lite/cmake-build-minnie/googletest/googlemock/CTestTestfile.cmake deleted file mode 100644 index 59a3fc27a51..00000000000 --- a/mindspore/lite/cmake-build-minnie/googletest/googlemock/CTestTestfile.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# CMake generated Testfile for -# Source directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/third_party/googletest/googlemock -# Build directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-minnie/googletest/googlemock -# -# This file includes the relevant testing commands required for -# testing this directory and lists subdirectories to be tested as well. -subdirs("gtest") diff --git a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gmock.cbp b/mindspore/lite/cmake-build-minnie/googletest/googlemock/gmock.cbp deleted file mode 100644 index 5ed2a552da5..00000000000 --- a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gmock.cbp +++ /dev/null @@ -1,517 +0,0 @@ - - - - - - diff --git a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/CTestTestfile.cmake b/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/CTestTestfile.cmake deleted file mode 100644 index caf7474c1db..00000000000 --- a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/CTestTestfile.cmake +++ /dev/null @@ -1,6 +0,0 @@ -# CMake generated Testfile for -# Source directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/third_party/googletest/googletest -# Build directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest -# -# This file includes the relevant testing commands required for -# testing this directory and lists subdirectories to be tested as well. diff --git a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/GTestConfig.cmake b/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/GTestConfig.cmake deleted file mode 100644 index 0ee9ec8f9f5..00000000000 --- a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/GTestConfig.cmake +++ /dev/null @@ -1,33 +0,0 @@ - -####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### -####### Any changes to this file will be overwritten by the next CMake run #### -####### The input file was Config.cmake.in ######## - -get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) - -macro(set_and_check _var _file) - set(${_var} "${_file}") - if(NOT EXISTS "${_file}") - message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") - endif() -endmacro() - -macro(check_required_components _NAME) - foreach(comp ${${_NAME}_FIND_COMPONENTS}) - if(NOT ${_NAME}_${comp}_FOUND) - if(${_NAME}_FIND_REQUIRED_${comp}) - set(${_NAME}_FOUND FALSE) - endif() - endif() - endforeach() -endmacro() - -#################################################################################### -include(CMakeFindDependencyMacro) -if (ON) - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_dependency(Threads) -endif() - -include("${CMAKE_CURRENT_LIST_DIR}/GTestTargets.cmake") -check_required_components("") diff --git a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/GTestConfigVersion.cmake b/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/GTestConfigVersion.cmake deleted file mode 100644 index b12397d6586..00000000000 --- a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/GTestConfigVersion.cmake +++ /dev/null @@ -1,37 +0,0 @@ -# This is a basic version file for the Config-mode of find_package(). -# It is used by write_basic_package_version_file() as input file for configure_file() -# to create a version-file which can be installed along a config.cmake file. -# -# The created file sets PACKAGE_VERSION_EXACT if the current version string and -# the requested version string are exactly the same and it sets -# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version. -# The variable CVF_VERSION must be set before calling configure_file(). - -set(PACKAGE_VERSION "1.9.0") - -if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) - set(PACKAGE_VERSION_COMPATIBLE FALSE) -else() - set(PACKAGE_VERSION_COMPATIBLE TRUE) - if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) - set(PACKAGE_VERSION_EXACT TRUE) - endif() -endif() - - -# if the installed project requested no architecture check, don't perform the check -if("FALSE") - return() -endif() - -# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") - return() -endif() - -# check that the installed version has the same 32/64bit-ness as the one which is currently searching: -if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") - math(EXPR installedBits "8 * 8") - set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") - set(PACKAGE_VERSION_UNSUITABLE TRUE) -endif() diff --git a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/gmock.pc b/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/gmock.pc deleted file mode 100644 index d4242cfa66f..00000000000 --- a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/gmock.pc +++ /dev/null @@ -1,9 +0,0 @@ -libdir=/usr/local/lib -includedir=/usr/local/include - -Name: gmock -Description: GoogleMock (without main() function) -Version: 1.9.0 -URL: https://github.com/google/googletest -Libs: -L${libdir} -lgmock -pthread -Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread diff --git a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/gmock_main.pc b/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/gmock_main.pc deleted file mode 100644 index 2da4fbcc017..00000000000 --- a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/gmock_main.pc +++ /dev/null @@ -1,9 +0,0 @@ -libdir=/usr/local/lib -includedir=/usr/local/include - -Name: gmock_main -Description: GoogleMock (with main() function) -Version: 1.9.0 -URL: https://github.com/google/googletest -Libs: -L${libdir} -lgmock_main -pthread -Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread diff --git a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/gtest.pc b/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/gtest.pc deleted file mode 100644 index a9931b8be97..00000000000 --- a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/gtest.pc +++ /dev/null @@ -1,9 +0,0 @@ -libdir=/usr/local/lib -includedir=/usr/local/include - -Name: gtest -Description: GoogleTest (without main() function) -Version: 1.9.0 -URL: https://github.com/google/googletest -Libs: -L${libdir} -lgtest -pthread -Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread diff --git a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/gtest_main.pc b/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/gtest_main.pc deleted file mode 100644 index 57948c76ee1..00000000000 --- a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/generated/gtest_main.pc +++ /dev/null @@ -1,10 +0,0 @@ -libdir=/usr/local/lib -includedir=/usr/local/include - -Name: gtest_main -Description: GoogleTest (with main() function) -Version: 1.9.0 -URL: https://github.com/google/googletest -Requires: gtest -Libs: -L${libdir} -lgtest_main -pthread -Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread diff --git a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/gtest.cbp b/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/gtest.cbp deleted file mode 100644 index b79931c4482..00000000000 --- a/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest/gtest.cbp +++ /dev/null @@ -1,327 +0,0 @@ - - - - - - diff --git a/mindspore/lite/cmake-build-minnie/googletest/googletest-distribution.cbp b/mindspore/lite/cmake-build-minnie/googletest/googletest-distribution.cbp deleted file mode 100644 index 429f759103f..00000000000 --- a/mindspore/lite/cmake-build-minnie/googletest/googletest-distribution.cbp +++ /dev/null @@ -1,517 +0,0 @@ - - - - - - diff --git a/mindspore/lite/cmake-build-minnie/src/runtime/kernel/arm/opclib/optimize.cbp b/mindspore/lite/cmake-build-minnie/src/runtime/kernel/arm/opclib/optimize.cbp deleted file mode 100644 index 07af7ee7791..00000000000 --- a/mindspore/lite/cmake-build-minnie/src/runtime/kernel/arm/opclib/optimize.cbp +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - diff --git a/mindspore/lite/src/ops/addn.cc b/mindspore/lite/src/ops/addn.cc index 6b9252cd39f..c8a8e4e0a83 100644 --- a/mindspore/lite/src/ops/addn.cc +++ b/mindspore/lite/src/ops/addn.cc @@ -36,6 +36,7 @@ int AddN::InferShape(std::vector inputs_, std::vectorSetFormat(input->GetFormat()); output->set_shape(input->shape()); output->set_data_type(input->data_type()); return RET_OK; diff --git a/mindspore/lite/src/ops/argmax.cc b/mindspore/lite/src/ops/argmax.cc index af94e597e7e..d71910e438e 100644 --- a/mindspore/lite/src/ops/argmax.cc +++ b/mindspore/lite/src/ops/argmax.cc @@ -40,6 +40,7 @@ int ArgMax::InferShape(std::vector inputs_, std::vectorSetFormat(input->GetFormat()); output->set_shape(output_shape); output->set_data_type(input->data_type()); return RET_OK; diff --git a/mindspore/lite/src/ops/argmin.cc b/mindspore/lite/src/ops/argmin.cc index 2323af643f4..b501b14b1c9 100644 --- a/mindspore/lite/src/ops/argmin.cc +++ b/mindspore/lite/src/ops/argmin.cc @@ -39,9 +39,9 @@ int ArgMin::InferShape(std::vector inputs_, std::vector output_shape(input->shape()); output_shape.erase(output_shape.begin() + axis); + output->SetFormat(input->GetFormat()); output->set_shape(output_shape); output->set_data_type(input->data_type()); return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/arithmetic.cc b/mindspore/lite/src/ops/arithmetic.cc index 2a6ce1320e2..2b15e22608c 100644 --- a/mindspore/lite/src/ops/arithmetic.cc +++ b/mindspore/lite/src/ops/arithmetic.cc @@ -39,7 +39,7 @@ int Arithmetic::InferShape(std::vector inputs_, std::vectorshape(); auto input_shape1 = input1->shape(); - + auto format = input0->GetFormat(); in_shape0_.resize(5); in_shape1_.resize(5); out_shape_.resize(5); @@ -57,6 +57,7 @@ int Arithmetic::InferShape(std::vector inputs_, std::vectorGetFormat(); } else if (input_shape0.size() > input_shape1.size()) { ndim_ = input_shape0.size(); auto fill_dim_num = input_shape0.size() - input_shape1.size(); @@ -93,7 +94,7 @@ int Arithmetic::InferShape(std::vector inputs_, std::vectorSetFormat(format); output->set_shape(output_shape); output->set_data_type(input0->data_type()); return RET_OK; diff --git a/mindspore/lite/src/ops/arithmetic_self.cc b/mindspore/lite/src/ops/arithmetic_self.cc index 567a190f6a6..3d2210e746c 100644 --- a/mindspore/lite/src/ops/arithmetic_self.cc +++ b/mindspore/lite/src/ops/arithmetic_self.cc @@ -26,9 +26,11 @@ int ArithmeticSelf::InferShape(std::vector inputs_, std::vecto MS_ASSERT(input != nullptr); auto output = outputs_.front(); MS_ASSERT(output != nullptr); + + output->SetFormat(input->GetFormat()); output->set_shape(input->shape()); output->set_data_type(input->data_type()); + return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/batch_to_space.cc b/mindspore/lite/src/ops/batch_to_space.cc index a3ca0b2b49d..41412c58c35 100644 --- a/mindspore/lite/src/ops/batch_to_space.cc +++ b/mindspore/lite/src/ops/batch_to_space.cc @@ -85,9 +85,10 @@ int BatchToSpace::InferShape(std::vector inputs, std::vectorGet(0) - crops->Get(0) - crops->Get(1); output_shape[kNHWC_w_index] = input_shape[kNHWC_w_index] * block_shape->Get(1) - crops->Get(2) - crops->Get(3); output_shape[kNHWC_c_index] = input_shape[kNHWC_c_index]; + + outputs[0]->SetFormat(input->GetFormat()); outputs[0]->set_shape(output_shape); outputs[0]->set_data_type(input->data_type()); return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/broadcast_to.cc b/mindspore/lite/src/ops/broadcast_to.cc index 225e34d6147..51e59146770 100644 --- a/mindspore/lite/src/ops/broadcast_to.cc +++ b/mindspore/lite/src/ops/broadcast_to.cc @@ -58,9 +58,9 @@ int BroadcastTo::InferShape(std::vector inputs, std::vectorSetFormat(input->GetFormat()); outputs[0]->set_shape(shape); outputs[0]->set_data_type(input->data_type()); return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/cast.cc b/mindspore/lite/src/ops/cast.cc index 796f80cbee0..13de84ff5e8 100644 --- a/mindspore/lite/src/ops/cast.cc +++ b/mindspore/lite/src/ops/cast.cc @@ -44,9 +44,9 @@ int Cast::InferShape(std::vector inputs_, std::vectordstT(); return RET_INPUT_TENSOR_ERROR; } + output->SetFormat(input->GetFormat()); output->set_shape(input->shape()); output->set_data_type(input->data_type()); return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/concat.cc b/mindspore/lite/src/ops/concat.cc index 2d966676d50..e69e2707a35 100644 --- a/mindspore/lite/src/ops/concat.cc +++ b/mindspore/lite/src/ops/concat.cc @@ -70,7 +70,8 @@ int Concat::InferShape(std::vector inputs_, std::vectorset_shape(output_shape); output->set_data_type(input0->data_type()); + output->SetFormat(input0->GetFormat()); + return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/crop.cc b/mindspore/lite/src/ops/crop.cc index b58b8a27f44..dceab29f9bf 100644 --- a/mindspore/lite/src/ops/crop.cc +++ b/mindspore/lite/src/ops/crop.cc @@ -32,7 +32,8 @@ int Crop::InferShape(std::vector inputs, std::vectorset_shape(inputs[1]->shape()); + outputs[0]->SetFormat(inputs[1]->GetFormat()); + return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/depth_to_space.cc b/mindspore/lite/src/ops/depth_to_space.cc index 025c1ad3603..f09fddfb588 100644 --- a/mindspore/lite/src/ops/depth_to_space.cc +++ b/mindspore/lite/src/ops/depth_to_space.cc @@ -23,7 +23,7 @@ namespace mindspore::lite { namespace { constexpr int kDepthToSpaceOutputNum = 1; constexpr int kDepthToSpaceInputNum = 1; -} +} // namespace int DepthToSpace::InferShape(std::vector inputs, std::vector outputs) { MS_ASSERT(this->primitive != nullptr); @@ -56,7 +56,8 @@ int DepthToSpace::InferShape(std::vector inputs, std::vectorset_shape(output_shape); outputs[0]->set_data_type(input->data_type()); + outputs[0]->SetFormat(input->GetFormat()); + return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/expand_dims.cc b/mindspore/lite/src/ops/expand_dims.cc index 588710f886c..5b0391d6541 100644 --- a/mindspore/lite/src/ops/expand_dims.cc +++ b/mindspore/lite/src/ops/expand_dims.cc @@ -45,7 +45,8 @@ int ExpandDims::InferShape(std::vector inputs_, std::vectorset_shape(out_shape); output->set_data_type(input->data_type()); + output->SetFormat(input->GetFormat()); + return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/fill.cc b/mindspore/lite/src/ops/fill.cc index 361a5e2b8df..f4bd0c1952f 100644 --- a/mindspore/lite/src/ops/fill.cc +++ b/mindspore/lite/src/ops/fill.cc @@ -42,7 +42,8 @@ int Fill::InferShape(std::vector inputs_, std::vectordims()->begin(), fill_prim->dims()->end()); output->set_shape(output_shape); output->set_data_type(input->data_type()); + output->SetFormat(input->GetFormat()); + return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/flatten.cc b/mindspore/lite/src/ops/flatten.cc index c2264afcf93..bde0cd16c56 100644 --- a/mindspore/lite/src/ops/flatten.cc +++ b/mindspore/lite/src/ops/flatten.cc @@ -43,7 +43,8 @@ int Flatten::InferShape(std::vector inputs_, std::vectorset_shape(output_shape); output->set_data_type(input->data_type()); + output->SetFormat(input->GetFormat()); + return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/fullconnection.cc b/mindspore/lite/src/ops/fullconnection.cc index 0b44faecfd8..7b4b1e051fe 100644 --- a/mindspore/lite/src/ops/fullconnection.cc +++ b/mindspore/lite/src/ops/fullconnection.cc @@ -56,7 +56,8 @@ int FullConnection::InferShape(std::vector inputs_, std::vecto out_shape[fc_prim->axis()] = input1->shape()[0]; output->set_shape(out_shape); output->set_data_type(input0->data_type()); + output->SetFormat(input0->GetFormat()); + return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/gather.cc b/mindspore/lite/src/ops/gather.cc index 0e5cd619186..328de9ba2f8 100644 --- a/mindspore/lite/src/ops/gather.cc +++ b/mindspore/lite/src/ops/gather.cc @@ -71,7 +71,8 @@ int Gather::InferShape(std::vector inputs_, std::vectorset_shape(out_shape); output->set_data_type(input->data_type()); + output->SetFormat(input->GetFormat()); + return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/gather_nd.cc b/mindspore/lite/src/ops/gather_nd.cc index 4f5598817bf..681e2d207ba 100644 --- a/mindspore/lite/src/ops/gather_nd.cc +++ b/mindspore/lite/src/ops/gather_nd.cc @@ -59,7 +59,8 @@ int GatherNd::InferShape(std::vector inputs_, std::vectorset_shape(out_shape); output->set_data_type(input->data_type()); + output->SetFormat(input->GetFormat()); + return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/matmul.cc b/mindspore/lite/src/ops/matmul.cc index d7cb772f41b..2d031378bfb 100644 --- a/mindspore/lite/src/ops/matmul.cc +++ b/mindspore/lite/src/ops/matmul.cc @@ -57,7 +57,8 @@ int MatMul::InferShape(std::vector inputs_, std::vectorset_shape(y_shape); output->set_data_type(input0->data_type()); + output->SetFormat(input0->GetFormat()); + return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/one_hot.cc b/mindspore/lite/src/ops/one_hot.cc index eb96edad891..878813c9951 100644 --- a/mindspore/lite/src/ops/one_hot.cc +++ b/mindspore/lite/src/ops/one_hot.cc @@ -67,6 +67,8 @@ int OneHot::InferShape(std::vector inputs, std::vectorset_data_type(on_value->data_type()); + output->SetFormat(on_value->GetFormat()); + return RET_OK; } } // namespace mindspore::lite diff --git a/mindspore/lite/src/ops/ops.cc b/mindspore/lite/src/ops/ops.cc index 642b2898fbb..63fe262aa62 100644 --- a/mindspore/lite/src/ops/ops.cc +++ b/mindspore/lite/src/ops/ops.cc @@ -138,7 +138,8 @@ int Primitive::InferShape(std::vector inputs_, std::vectorset_shape(input->shape()); output->set_data_type(input->data_type()); + output->SetFormat(input->GetFormat()); + return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/pad.cc b/mindspore/lite/src/ops/pad.cc index 8604da24e3f..3bdbe04235e 100644 --- a/mindspore/lite/src/ops/pad.cc +++ b/mindspore/lite/src/ops/pad.cc @@ -55,9 +55,9 @@ int Pad::InferShape(std::vector inputs, std::vectorSetFormat(input->GetFormat()); output->set_shape(output_shape); output->set_data_type(input->data_type()); return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/pooling.cc b/mindspore/lite/src/ops/pooling.cc index c25a558bbce..20745e7cd0b 100644 --- a/mindspore/lite/src/ops/pooling.cc +++ b/mindspore/lite/src/ops/pooling.cc @@ -74,6 +74,7 @@ int Pooling::InferShape(std::vector inputs_, std::vectorset_shape(input_shape); output->set_data_type(input->data_type()); + // todo: temp fix output->SetFormat(schema::Format_NHWC); return RET_OK; diff --git a/mindspore/lite/src/ops/range.cc b/mindspore/lite/src/ops/range.cc index 4adafa26898..53180a8d518 100644 --- a/mindspore/lite/src/ops/range.cc +++ b/mindspore/lite/src/ops/range.cc @@ -34,7 +34,8 @@ int Range::InferShape(std::vector inputs_, std::vectorset_shape(in_shape); output->set_data_type(input->data_type()); + output->SetFormat(input->GetFormat()); + return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/rank.cc b/mindspore/lite/src/ops/rank.cc index c7b70930b14..5939396d163 100644 --- a/mindspore/lite/src/ops/rank.cc +++ b/mindspore/lite/src/ops/rank.cc @@ -29,7 +29,8 @@ int Rank::InferShape(std::vector inputs_, std::vector in_shape(1, 1); output->set_shape(in_shape); output->set_data_type(input->data_type()); + output->SetFormat(input->GetFormat()); + return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/reduce.cc b/mindspore/lite/src/ops/reduce.cc index 888a61df875..76ce8199776 100644 --- a/mindspore/lite/src/ops/reduce.cc +++ b/mindspore/lite/src/ops/reduce.cc @@ -73,6 +73,8 @@ int Reduce::InferShape(std::vector inputs_, std::vectorset_shape(out_shape); output->set_data_type(input->data_type()); + output->SetFormat(input->GetFormat()); + return RET_OK; } } // namespace mindspore::lite diff --git a/mindspore/lite/src/ops/reshape.cc b/mindspore/lite/src/ops/reshape.cc index 3e2a9c6eef8..1358769bb37 100644 --- a/mindspore/lite/src/ops/reshape.cc +++ b/mindspore/lite/src/ops/reshape.cc @@ -114,7 +114,8 @@ int Reshape::InferShape(std::vector inputs_, std::vectorset_shape(out_shape); output->set_data_type(input->data_type()); + output->SetFormat(input->GetFormat()); + return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/resize.cc b/mindspore/lite/src/ops/resize.cc index 7dd387c6369..9b7edd2d9e6 100644 --- a/mindspore/lite/src/ops/resize.cc +++ b/mindspore/lite/src/ops/resize.cc @@ -45,7 +45,8 @@ int Resize::InferShape(std::vector inputs_, std::vectorChannel()); output->set_shape(output_shape); output->set_data_type(input->data_type()); + output->SetFormat(input->GetFormat()); + return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/scatter_nd.cc b/mindspore/lite/src/ops/scatter_nd.cc index cf9f4dfbc35..446a37d8720 100644 --- a/mindspore/lite/src/ops/scatter_nd.cc +++ b/mindspore/lite/src/ops/scatter_nd.cc @@ -57,7 +57,8 @@ int ScatterND::InferShape(std::vector inputs_, std::vector out_shape(shape_data, shape_data + sizeof(shape_data) / sizeof(shape_data[0])); output->set_shape(out_shape); output->set_data_type(update->data_type()); + output->SetFormat(update->GetFormat()); + return RET_OK; } } // namespace mindspore::lite - diff --git a/mindspore/lite/src/ops/slice.cc b/mindspore/lite/src/ops/slice.cc index 994fabb1cc5..c1fe1d396db 100644 --- a/mindspore/lite/src/ops/slice.cc +++ b/mindspore/lite/src/ops/slice.cc @@ -23,7 +23,7 @@ namespace mindspore::lite { namespace { constexpr int kSliceInputNum = 1; constexpr int kSliceOutputNum = 1; -} +} // namespace int Slice::InferShape(std::vector inputs, std::vector outputs) { MS_ASSERT(this->primitive != nullptr); @@ -47,13 +47,13 @@ int Slice::InferShape(std::vector inputs, std::vector