forked from mindspore-Ecosystem/mindspore
replace log defalt to WARNING and fix cppcheck's questions
This commit is contained in:
parent
981251d541
commit
7fa2145c0c
|
@ -46,9 +46,9 @@ bool IsPrint(int level) {
|
|||
static const char *env = std::getenv("MSLOG");
|
||||
static int ms_level = EnvToInt(env);
|
||||
if (ms_level < 0) {
|
||||
ms_level = 1;
|
||||
ms_level = 2;
|
||||
printf("please set env MSLOG DEBUG/INFO/WARNING/ERROR\n");
|
||||
printf("the default is INFO\n");
|
||||
printf("the default is WARNING\n");
|
||||
}
|
||||
return level >= ms_level;
|
||||
}
|
||||
|
|
|
@ -126,10 +126,10 @@ void IndirectGemmInt8Opt(int8_t *dst, int32_t *tmp_dst, const int8_t *src, const
|
|||
|
||||
void Conv3x3Uint8Gemm(int32_t *dst, const int16_t *src, const int16_t *weight, int oc, int ic8, size_t real_cal_num) {
|
||||
int oc4 = UP_DIV(oc, C4NUM);
|
||||
int input_unit_square = 16;
|
||||
#ifdef ENABLE_ARM
|
||||
IndirectGemmInt16to32_8x4(dst, src, weight, 16, ic8, oc4, oc4 * 4 * 16 * sizeof(int32_t));
|
||||
#else
|
||||
int input_unit_square = 16;
|
||||
for (int c = 0; c < oc4; c++) {
|
||||
int filter_oc_offset = c * input_unit_square * ic8 * C8NUM * C4NUM;
|
||||
int dst_oc_offset = c * input_unit_square * C4NUM;
|
||||
|
|
|
@ -149,8 +149,14 @@ STATUS FormatTransFusionPass::DoFusion(schema::MetaGraphT *graph, const std::str
|
|||
} else {
|
||||
MS_ASSERT(false);
|
||||
}
|
||||
MS_ASSERT(srcPath != nullptr);
|
||||
MS_ASSERT(dstPath != nullptr);
|
||||
if (srcPath == nullptr) {
|
||||
MS_LOG(ERROR) << "srcPath is failed to get";
|
||||
return RET_ERROR;
|
||||
}
|
||||
if (dstPath == nullptr) {
|
||||
MS_LOG(ERROR) << "dstPath is failed to get";
|
||||
return RET_ERROR;
|
||||
}
|
||||
auto srcNode = graph->nodes.at(srcPath->nodeIdx).get();
|
||||
auto dstNode = graph->nodes.at(dstPath->nodeIdx).get();
|
||||
MS_ASSERT(srcNode != nullptr);
|
||||
|
|
|
@ -47,7 +47,6 @@ TypeId OnnxModelParser::GetDateTypeFromOnnx(onnx::TensorProto_DataType onnx_type
|
|||
|
||||
std::vector<int32_t> OnnxModelParser::GetDimsFromOnnxValue(const onnx::ValueInfoProto &onnx_value) {
|
||||
std::vector<int32_t> dims;
|
||||
const auto shape_info = onnx_value.type().tensor_type().shape();
|
||||
for (const auto &it : onnx_value.type().tensor_type().shape().dim()) {
|
||||
dims.emplace_back(it.dim_value());
|
||||
}
|
||||
|
@ -97,7 +96,7 @@ STATUS OnnxModelParser::SetGraphConstTensor(const onnx::GraphProto &onnx_graph,
|
|||
if (CopyOnnxTensorData(onnx_const_value, tensor.get())) {
|
||||
return RET_ERROR;
|
||||
}
|
||||
const auto index = tensor_cache->AddTensor(onnx_const_value.name(), tensor.release(), GRAPH_INPUT);
|
||||
// const auto index = tensor_cache->AddTensor(onnx_const_value.name(), tensor.release(), GRAPH_INPUT);
|
||||
// MS_LOGD("add const tensor: %s, index %d", onnx_const_value.name().c_str(), index)
|
||||
}
|
||||
return RET_OK;
|
||||
|
@ -290,11 +289,6 @@ void OnnxModelParser::SetOpQuantParams(const onnx::GraphProto &onnx_graph, const
|
|||
// MS_LOGE("new QuantParamT failed, node: %s", dst_op->name.c_str());
|
||||
return;
|
||||
}
|
||||
// std::unique_ptr<mindspore::lite::QuantParamArrayT> quant_param_array(new (std::nothrow) QuantParamArrayT());
|
||||
if (quant_param == nullptr) {
|
||||
// MS_LOGE("new QuantParamArrayT failed, node: %s", dst_op->name.c_str());
|
||||
return;
|
||||
}
|
||||
int argNum = 0;
|
||||
for (const auto &onnx_node_attr : node.attribute()) {
|
||||
if (onnx_node_attr.name() == "Y_scale") {
|
||||
|
|
Loading…
Reference in New Issue