From b3b93e2f260e89c680e0dee43205904d214737e0 Mon Sep 17 00:00:00 2001 From: fangzhou12 Date: Fri, 9 Jun 2023 15:35:41 +0800 Subject: [PATCH] log modeify --- mindspore/lite/src/runtime/js_api/mslite_model_napi.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mindspore/lite/src/runtime/js_api/mslite_model_napi.cc b/mindspore/lite/src/runtime/js_api/mslite_model_napi.cc index 6cccb259..7ee4b071 100644 --- a/mindspore/lite/src/runtime/js_api/mslite_model_napi.cc +++ b/mindspore/lite/src/runtime/js_api/mslite_model_napi.cc @@ -354,7 +354,7 @@ int32_t MSLiteModelNapi::ParseContextInfo(napi_env env, napi_value args, Context napi_valuetype valueType; napi_status status = napi_typeof(env, args, &valueType); if ((status != napi_ok) || (valueType != napi_object)) { - MS_LOG(ERROR) << "model is invaild."; + MS_LOG(ERROR) << "context is invaild."; return ERR_NOT_EXISTED_PARAM; } @@ -692,6 +692,10 @@ int32_t MSLiteModelNapi::GetCpuDeviceInfo(napi_env env, napi_value args, Context if (CommonNapi::GetPropertyInt32(env, config_item, "threadAffinityMode", int_value) == SUCCESS) { MS_LOG(DEBUG) << "threadAffinityMode: " << int_value; + if (int_value > PARAM2 || int_value < PARAM0) { + MS_LOG(ERROR) << "threadAffinityMode value is set out of limitions"; + return ERR_INVALID_OPERATION; + } context.cpu_device.thread_affinity_mode = int_value; } else { context.cpu_device.thread_affinity_mode = PARAM0; @@ -730,7 +734,7 @@ napi_value MSLiteModelNapi::GetInputs(napi_env env, napi_callback_info info) { status = napi_unwrap(env, jsThis, reinterpret_cast(&modelNapi)); if (status != napi_ok || modelNapi == nullptr) { - MS_LOG(ERROR) << "get model napi error"; + MS_LOG(ERROR) << "Failed to get model"; return undefinedResult; } @@ -893,7 +897,6 @@ napi_value MSLiteModelNapi::Resize(napi_env env, napi_callback_info info) { } status = napi_get_array_length(env, dim_element, &dim_size); - MS_LOG(ERROR) << "DIM SIZE IS:" << dim_size; if (status != napi_ok) { MS_LOG(ERROR) << "get new dim size error"; return undefinedResult; -- 2.17.1