forked from huawei/mindspore2022
!12882 [MD][bugfix] Fix line_of_code print twice issue
From: @xiefangqi Reviewed-by: @heleiwang,@pandoublefeng Signed-off-by: @pandoublefeng
This commit is contained in:
commit
5135c214b7
|
|
@ -470,7 +470,7 @@ Status CifarOp::CountTotalRows(const std::string &dir, const std::string &usage,
|
|||
|
||||
std::ifstream in(file, std::ios::binary);
|
||||
|
||||
CHECK_FAIL_RETURN_UNEXPECTED(in.is_open(), file + " can not be opened.");
|
||||
CHECK_FAIL_RETURN_UNEXPECTED(in.is_open(), "Invalid file, failed to open cifar10 file: " + file);
|
||||
*count = *count + num_cifar10_records;
|
||||
}
|
||||
return Status::OK();
|
||||
|
|
@ -492,7 +492,7 @@ Status CifarOp::CountTotalRows(const std::string &dir, const std::string &usage,
|
|||
num_cifar100_records += 50000;
|
||||
}
|
||||
std::ifstream in(file, std::ios::binary);
|
||||
CHECK_FAIL_RETURN_UNEXPECTED(in.is_open(), "Invalid file, failed to open file: " + file);
|
||||
CHECK_FAIL_RETURN_UNEXPECTED(in.is_open(), "Invalid file, failed to open cifar100 file: " + file);
|
||||
}
|
||||
*count = num_cifar100_records;
|
||||
return Status::OK();
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ Status::Status(enum StatusCode status_code, const std::vector<char> &status_msg)
|
|||
return;
|
||||
}
|
||||
|
||||
data_->err_description = CharToString(status_msg);
|
||||
data_->status_msg = CharToString(status_msg);
|
||||
data_->status_code = status_code;
|
||||
}
|
||||
|
|
@ -96,7 +97,7 @@ std::vector<char> Status::GetErrDescriptionChar() const {
|
|||
if (data_ == nullptr) {
|
||||
return std::vector<char>();
|
||||
}
|
||||
return StringToChar(data_->status_msg);
|
||||
return StringToChar(data_->err_description);
|
||||
}
|
||||
|
||||
std::vector<char> Status::CodeAsCString(enum StatusCode c) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue