From dfd9df577dc6acc8af64641ecc37a6288135142c Mon Sep 17 00:00:00 2001 From: YangLuo Date: Thu, 29 Oct 2020 20:08:18 +0800 Subject: [PATCH] [MD] code review --- .../dataset/engine/ir/datasetops/source/minddata_node.cc | 4 ++-- mindspore/dataset/vision/c_transforms.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/source/minddata_node.cc b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/source/minddata_node.cc index 6b2004a1567..9e05ec0ac70 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/source/minddata_node.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/source/minddata_node.cc @@ -70,9 +70,9 @@ Status MindDataNode::ValidateParams() { } if (padded_sample_ != nullptr) { - if (num_padded_ < 0) { + if (num_padded_ < 0 || num_padded_ > INT_MAX) { 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; RETURN_STATUS_SYNTAX_ERROR(err_msg); } diff --git a/mindspore/dataset/vision/c_transforms.py b/mindspore/dataset/vision/c_transforms.py index c92b609f670..5047f00e567 100644 --- a/mindspore/dataset/vision/c_transforms.py +++ b/mindspore/dataset/vision/c_transforms.py @@ -560,7 +560,7 @@ class RandomPosterize(cde.RandomPosterizeOp): Bits values must be in range of [1,8], and include at 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 - magnitude operation (default=[4, 8]). + magnitude operation (default=[8, 8]). Examples: >>> import mindspore.dataset.vision.c_transforms as c_vision