Browse Source

error message add format

tags/v1.1.0
wangwenhua1@huawei.com 4 years ago
parent
commit
fdefa146ac
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      ge/common/formats/format_transfers/datatype_transfer.cc
  2. +2
    -2
      ge/common/formats/utils/formats_trans_utils.cc

+ 1
- 1
ge/common/formats/format_transfers/datatype_transfer.cc View File

@@ -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;
}


+ 2
- 2
ge/common/formats/utils/formats_trans_utils.cc View File

@@ -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;
@@ -74,7 +74,7 @@ bool IsShapeValid(const std::vector<int64_t> &shape) {
int64_t num = 1;
for (auto dim : shape) {
if (dim < 0) {
std::string error = "Invalid negative dims in the shape " + FmtToStr(ShapeToString(shape));
std::string error = "Invalid negative dims in the shape " + FmtToStr(ShapeToString(shape));
GE_ERRORLOG_AND_ERRORMSG(PARAM_INVALID, error.c_str());
return false;
}


Loading…
Cancel
Save