diff --git a/mindspore/lite/nnacl/minimal_filtering_generator.c b/mindspore/lite/nnacl/minimal_filtering_generator.c index d9a4b3094ce..bac28b4aedd 100644 --- a/mindspore/lite/nnacl/minimal_filtering_generator.c +++ b/mindspore/lite/nnacl/minimal_filtering_generator.c @@ -257,6 +257,9 @@ void MatrixMultiplyVec(const float32x4_t *matrix_a, const float32x4_t *matrix_b, int WinogradWeightTransform(const float *weight_data, float *winograd_data, float *matrix_g, const float *matrix_gt, int oc_block, int input_unit, int kernel_unit, int channel, int batch, bool pack) { + if (oc_block == 0) { + return NNACL_PARAM_INVALID; + } // original weight format : ohwi int oc_block_num = UP_DIV(batch, oc_block); int block_stride = channel * oc_block; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sparse_softmax_cross_entropy_with_logits.cc b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sparse_softmax_cross_entropy_with_logits.cc index 4e29045ef23..01135de869f 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sparse_softmax_cross_entropy_with_logits.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32_grad/sparse_softmax_cross_entropy_with_logits.cc @@ -101,7 +101,7 @@ int SparseSoftmaxCrossEntropyWithLogitsCPUKernel::Execute(int task_id) { Softmax(ins, losses_, sum_data_, &sm_params_); if (is_train()) { GradPostExecute(labels, losses_, grads, out); - } else if (out != nullptr) { + } else { ForwardPostExecute(labels, losses_, out); } return RET_OK; diff --git a/mindspore/lite/src/runtime/thread_pool.c b/mindspore/lite/src/runtime/thread_pool.c index 4bb87cec535..dbed7bcb59b 100644 --- a/mindspore/lite/src/runtime/thread_pool.c +++ b/mindspore/lite/src/runtime/thread_pool.c @@ -835,6 +835,10 @@ ThreadPool *CreateThreadPool(int thread_num, int mode) { } #endif ThreadPool *thread_pool = (struct ThreadPool *)(malloc(sizeof(ThreadPool))); + if (thread_pool == NULL) { + LOG_ERROR("Malloc ThreadPool failed"); + return NULL; + } thread_pool->thread_num = thread_num > MAX_THREAD_NUM ? MAX_THREAD_NUM : thread_num; thread_pool->is_alive = ATOMIC_VAR_INIT(true); thread_pool->mode = mode; diff --git a/mindspore/lite/tools/benchmark/benchmark.cc b/mindspore/lite/tools/benchmark/benchmark.cc index 0d7f10d634e..3d3bc9ab690 100644 --- a/mindspore/lite/tools/benchmark/benchmark.cc +++ b/mindspore/lite/tools/benchmark/benchmark.cc @@ -275,7 +275,7 @@ int Benchmark::CompareStringData(const std::string &name, tensor::MSTensor *tens std::cout << " " << output_strings[i] << std::endl; } if (calib_strings[i] != output_strings[i]) { - MS_LOG(ERROR) << ""; + MS_LOG(ERROR) << "Compare failed, index: " << i; return RET_ERROR; } }