!7845 [MD]fix ExtractChannel channel bugs

Merge pull request !7845 from xulei/lite_test0905
This commit is contained in:
mindspore-ci-bot 2020-10-28 14:21:26 +08:00 committed by Gitee
commit 175a3b12b0
4 changed files with 16 additions and 3 deletions

View File

@ -67,7 +67,7 @@ if (BUILD_MINDDATA STREQUAL "lite_cv")
install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv DESTINATION ${MIND_DATA_INC_DIR} COMPONENT ${COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv DESTINATION ${MIND_DATA_INC_DIR} COMPONENT ${COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${MIND_DATA_LIB_DIR} COMPONENT ${COMPONENT_NAME}) install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${MIND_DATA_LIB_DIR} COMPONENT ${COMPONENT_NAME})
else () else ()
install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv DESTINATION ${MIND_DATA_INC_DIR_RUN_X86} COMPONENT ${COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv DESTINATION ${MIND_DATA_INC_DIR_RUN_X86} COMPONENT ${RUN_X86_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${MIND_DATA_LIB_DIR_RUN_X86} COMPONENT ${RUN_X86_COMPONENT_NAME}) install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${MIND_DATA_LIB_DIR_RUN_X86} COMPONENT ${RUN_X86_COMPONENT_NAME})
endif () endif ()
endif () endif ()

View File

@ -620,11 +620,11 @@ static void PadWithConstant(const LiteMat &src, LiteMat &dst, const int top, con
} }
bool ExtractChannel(const LiteMat &src, LiteMat &dst, int col) { bool ExtractChannel(const LiteMat &src, LiteMat &dst, int col) {
if (src.IsEmpty() || col < 0 || col > src.dims_ - 1) { if (src.IsEmpty() || col < 0 || col > src.channel_ - 1) {
return false; return false;
} }
(void)dst.Init(src.width_, src.height_, 1, src.data_type_);
if (src.data_type_ == LDataType::FLOAT32) { if (src.data_type_ == LDataType::FLOAT32) {
(void)dst.Init(src.width_, src.height_, 1, src.data_type_);
const float *src_start_p = src; const float *src_start_p = src;
float *dst_start_p = dst; float *dst_start_p = dst;
for (int h = 0; h < src.height_; h++) { for (int h = 0; h < src.height_; h++) {
@ -638,6 +638,7 @@ bool ExtractChannel(const LiteMat &src, LiteMat &dst, int col) {
} }
return true; return true;
} else if (src.data_type_ == LDataType::UINT8) { } else if (src.data_type_ == LDataType::UINT8) {
(void)dst.Init(src.width_, src.height_, 1, src.data_type_);
const uint8_t *src_start_p = src; const uint8_t *src_start_p = src;
uint8_t *dst_start_p = dst; uint8_t *dst_start_p = dst;
for (int h = 0; h < src.height_; h++) { for (int h = 0; h < src.height_; h++) {

View File

@ -168,6 +168,12 @@ if (PLATFORM_ARM64)
endif () endif ()
endif () endif ()
if (PLATFORM_ARM32 OR PLATFORM_ARM64)
if (ENABLE_CONVERTER)
set(BUILD_MINDDATA "off")
endif()
endif()
if (BUILD_MINDDATA STREQUAL "lite" OR BUILD_MINDDATA STREQUAL "full") if (BUILD_MINDDATA STREQUAL "lite" OR BUILD_MINDDATA STREQUAL "full")
# add sentencepiece dependency # add sentencepiece dependency
# include(${TOP_DIR}/cmake/external_libs/sentencepiece.cmake) # include(${TOP_DIR}/cmake/external_libs/sentencepiece.cmake)

View File

@ -88,6 +88,12 @@ if (SUPPORT_GPU)
${LITE_DIR}/src/runtime/kernel/opencl/utils.cc ${LITE_DIR}/src/runtime/kernel/opencl/utils.cc
) )
endif() endif()
if (PLATFORM_ARM32 OR PLATFORM_ARM64)
if (ENABLE_CONVERTER)
set(BUILD_MINDDATA "off")
endif()
endif()
### minddata lite ### minddata lite
if (BUILD_MINDDATA STREQUAL "lite") if (BUILD_MINDDATA STREQUAL "lite")
# include_directories(${CCSRC_DIR}/minddata) # include_directories(${CCSRC_DIR}/minddata)