From b77ca9049f25ff098cce124f44046904b40c0cbd Mon Sep 17 00:00:00 2001 From: wangxiaotian22 Date: Wed, 20 Jan 2021 15:27:04 +0800 Subject: [PATCH] mod format_trans log level error to warning --- ge/common/formats/utils/formats_trans_utils.cc | 12 ++++++------ inc/framework/common/debug/log.h | 6 ++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ge/common/formats/utils/formats_trans_utils.cc b/ge/common/formats/utils/formats_trans_utils.cc index 18f2d70f..052951ce 100755 --- a/ge/common/formats/utils/formats_trans_utils.cc +++ b/ge/common/formats/utils/formats_trans_utils.cc @@ -32,7 +32,7 @@ int64_t GetCubeSizeByDataType(DataType data_type) { if (size <= 0) { std::string error = "Failed to get cube size, the data type " + FmtToStr(TypeUtils::DataTypeToSerialString(data_type)) + " is invalid"; - GE_ERRORLOG_AND_ERRORMSG(PARAM_INVALID, error.c_str()); + GE_WARNINGLOG_AND_ERRORMSG(error.c_str()); return -1; } else if (size == 1) { return kCubeSize * 2; // 32 bytes cube size @@ -61,7 +61,7 @@ bool CheckShapeValid(const std::vector &shape, const int64_t expect_dim if (expect_dims <= 0 || shape.size() != static_cast(expect_dims)) { std::string error = "Invalid shape, dims num " + FmtToStr(shape.size()) + ", expect " + FmtToStr(expect_dims); - GE_ERRORLOG_AND_ERRORMSG(PARAM_INVALID, error.c_str()); + GE_WARNINGLOG_AND_ERRORMSG(error.c_str()); return false; } return IsShapeValid(shape); @@ -75,12 +75,12 @@ bool IsShapeValid(const std::vector &shape) { for (auto dim : shape) { if (dim < 0) { std::string error = "Invalid negative dims in the shape " + FmtToStr(ShapeToString(shape)); - GE_ERRORLOG_AND_ERRORMSG(PARAM_INVALID, error.c_str()); + GE_WARNINGLOG_AND_ERRORMSG(error.c_str()); return false; } if (dim != 0 && kShapeItemNumMAX / dim < num) { std::string error = "Shape overflow, the total count should be less than " + FmtToStr(kShapeItemNumMAX); - GE_ERRORLOG_AND_ERRORMSG(PARAM_INVALID, error.c_str()); + GE_WARNINGLOG_AND_ERRORMSG(error.c_str()); return false; } num *= dim; @@ -108,7 +108,7 @@ bool IsTransShapeSrcCorrect(const TransArgs &args, std::vector &expect_ FmtToStr(TypeUtils::FormatToSerialString(args.dst_format)) + ", invalid relationship between src shape " + FmtToStr(ShapeToString(args.src_shape)) + " and dst " + FmtToStr(ShapeToString(args.dst_shape)); - GE_ERRORLOG_AND_ERRORMSG(PARAM_INVALID, error.c_str()); + GE_WARNINGLOG_AND_ERRORMSG(error.c_str()); return false; } return true; @@ -121,7 +121,7 @@ bool IsTransShapeDstCorrect(const TransArgs &args, std::vector &expect_ FmtToStr(TypeUtils::FormatToSerialString(args.dst_format)) + ", the dst shape" + FmtToStr(ShapeToString(args.dst_shape)) + " is invalid, expect" + FmtToStr(ShapeToString(expect_shape)); - GE_ERRORLOG_AND_ERRORMSG(PARAM_INVALID, error.c_str()); + GE_WARNINGLOG_AND_ERRORMSG(error.c_str()); return false; } return true; diff --git a/inc/framework/common/debug/log.h b/inc/framework/common/debug/log.h index 72dba126..31281cd6 100644 --- a/inc/framework/common/debug/log.h +++ b/inc/framework/common/debug/log.h @@ -261,6 +261,12 @@ ErrorManager::GetInstance().ATCReportErrMessage("E19021", {"reason"}, {errormsg}); \ } +#define GE_WARNINGLOG_AND_ERRORMSG(errormsg) \ + { \ + GELOGW("%s", errormsg); \ + ErrorManager::GetInstance().ATCReportErrMessage("E19021", {"reason"}, {errormsg}); \ + } + #define GE_CHK_LOG_AND_ERRORMSG(expr, _status, errormsg) \ do { \ bool b = (expr); \