提交 5aad4bdf 编写于 作者: P panfengfeng

change size

上级 25e587e4
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册