[MD] code review

This commit is contained in:
YangLuo 2020-10-29 20:08:18 +08:00
parent 32d6ed3e28
commit dfd9df577d
2 changed files with 3 additions and 3 deletions

View File

@ -70,9 +70,9 @@ Status MindDataNode::ValidateParams() {
} }
if (padded_sample_ != nullptr) { if (padded_sample_ != nullptr) {
if (num_padded_ < 0) { if (num_padded_ < 0 || num_padded_ > INT_MAX) {
std::string err_msg = std::string err_msg =
"MindDataNode: num_padded must be greater than or equal to zero, num_padded: " + std::to_string(num_padded_); "MindDataNode: num_padded must to be between 0 and INT32_MAX, but got: " + std::to_string(num_padded_);
MS_LOG(ERROR) << err_msg; MS_LOG(ERROR) << err_msg;
RETURN_STATUS_SYNTAX_ERROR(err_msg); RETURN_STATUS_SYNTAX_ERROR(err_msg);
} }

View File

@ -560,7 +560,7 @@ class RandomPosterize(cde.RandomPosterizeOp):
Bits values must be in range of [1,8], and include at Bits values must be in range of [1,8], and include at
least one integer value in the given range. It must be in least one integer value in the given range. It must be in
(min, max) or integer format. If min=max, then it is a single fixed (min, max) or integer format. If min=max, then it is a single fixed
magnitude operation (default=[4, 8]). magnitude operation (default=[8, 8]).
Examples: Examples:
>>> import mindspore.dataset.vision.c_transforms as c_vision >>> import mindspore.dataset.vision.c_transforms as c_vision