error message add format

pull/311/head
wangwenhua1@huawei.com 4 years ago
parent 297f87423c
commit fdefa146ac

@ -141,7 +141,7 @@ Status DataTypeTransfer::TransDataType(const CastArgs &args, TransResult &result
}
if (args.src_data_size > static_cast<size_t>(SIZE_MAX / size)) {
std::string error = "args.src_data_size" + FmtToStr(args.src_data_size) +
" or data type size" + FmtToStr(std::to_string(size)) + " is too big";
" or data type size" + FmtToStr(size) + " is too big";
GE_ERRORLOG_AND_ERRORMSG(PARAM_INVALID, error.c_str());
return PARAM_INVALID;
}

@ -59,7 +59,7 @@ int64_t GetItemNumByShape(const std::vector<int64_t> &shape) {
bool CheckShapeValid(const std::vector<int64_t> &shape, const int64_t expect_dims) {
if (expect_dims <= 0 || shape.size() != static_cast<size_t>(expect_dims)) {
std::string error = " Invalid shape, dims num " + FmtToStr(shape.size()) +
std::string error = "Invalid shape, dims num " + FmtToStr(shape.size()) +
", expect " + FmtToStr(expect_dims);
GE_ERRORLOG_AND_ERRORMSG(PARAM_INVALID, error.c_str());
return false;

Loading…
Cancel
Save