!8343 [MSLITE][Develop] fix code

From: @sunsuodong
Reviewed-by: @zhang_xue_tong,@zhanghaibo5
Signed-off-by: @zhang_xue_tong
This commit is contained in:
mindspore-ci-bot 2020-11-09 14:29:07 +08:00 committed by Gitee
commit 5708bae7e7
4 changed files with 9 additions and 2 deletions

View File

@ -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 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) { 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 // original weight format : ohwi
int oc_block_num = UP_DIV(batch, oc_block); int oc_block_num = UP_DIV(batch, oc_block);
int block_stride = channel * oc_block; int block_stride = channel * oc_block;

View File

@ -101,7 +101,7 @@ int SparseSoftmaxCrossEntropyWithLogitsCPUKernel::Execute(int task_id) {
Softmax(ins, losses_, sum_data_, &sm_params_); Softmax(ins, losses_, sum_data_, &sm_params_);
if (is_train()) { if (is_train()) {
GradPostExecute(labels, losses_, grads, out); GradPostExecute(labels, losses_, grads, out);
} else if (out != nullptr) { } else {
ForwardPostExecute(labels, losses_, out); ForwardPostExecute(labels, losses_, out);
} }
return RET_OK; return RET_OK;

View File

@ -835,6 +835,10 @@ ThreadPool *CreateThreadPool(int thread_num, int mode) {
} }
#endif #endif
ThreadPool *thread_pool = (struct ThreadPool *)(malloc(sizeof(ThreadPool))); 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->thread_num = thread_num > MAX_THREAD_NUM ? MAX_THREAD_NUM : thread_num;
thread_pool->is_alive = ATOMIC_VAR_INIT(true); thread_pool->is_alive = ATOMIC_VAR_INIT(true);
thread_pool->mode = mode; thread_pool->mode = mode;

View File

@ -275,7 +275,7 @@ int Benchmark::CompareStringData(const std::string &name, tensor::MSTensor *tens
std::cout << " " << output_strings[i] << std::endl; std::cout << " " << output_strings[i] << std::endl;
} }
if (calib_strings[i] != output_strings[i]) { if (calib_strings[i] != output_strings[i]) {
MS_LOG(ERROR) << ""; MS_LOG(ERROR) << "Compare failed, index: " << i;
return RET_ERROR; return RET_ERROR;
} }
} }