forked from OSSInnovation/mindspore
change size
This commit is contained in:
parent
25e587e483
commit
5aad4bdfbf
|
@ -37,8 +37,8 @@ Status CenterCropOp::Compute(const std::shared_ptr<Tensor> &input, std::shared_p
|
|||
int32_t left = crop_wid_ - input->shape()[1];
|
||||
std::shared_ptr<Tensor> pad_image;
|
||||
|
||||
CHECK_FAIL_RETURN_UNEXPECTED((top < input->shape()[0] * 10 && left < input->shape()[1] * 10),
|
||||
"CenterCropOp padding size is too big, it's more than 10 times the original size.");
|
||||
CHECK_FAIL_RETURN_UNEXPECTED((top < input->shape()[0] * 3 && left < input->shape()[1] * 3),
|
||||
"CenterCropOp padding size is too big, it's more than 3 times the original size.");
|
||||
|
||||
if (top > 0 && left > 0) { // padding only
|
||||
return Pad(input, output, top / 2 + top % 2, top / 2, left / 2 + left % 2, left / 2, BorderType::kConstant);
|
||||
|
|
|
@ -145,7 +145,7 @@ def test_center_crop_errors():
|
|||
try:
|
||||
test_center_crop_op(16777216, 16777216)
|
||||
except RuntimeError as e:
|
||||
assert "Unexpected error. CenterCropOp padding size is too big, it's more than 10 times the original size." in \
|
||||
assert "Unexpected error. CenterCropOp padding size is too big, it's more than 3 times the original size." in \
|
||||
str(e)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue