diff --git a/mace/ops/opencl/image/crop.h b/mace/ops/opencl/image/crop.h index e390a6ca69a2712dc1959c75ece199255011a173..d121b76339239ffd3964a9b756e6bebfaa838d48 100644 --- a/mace/ops/opencl/image/crop.h +++ b/mace/ops/opencl/image/crop.h @@ -71,18 +71,15 @@ MaceStatus CropKernel::Compute( output_shape[i] = input1->dim(i); offsets[i] = offset_[i]; MACE_CHECK(input0->dim(i) - offset_[i] >= input1->dim(i)) - << "the crop for dimension " << i << " is out of bound with size " - << input1->dim(i) << " and offset " << offsets[i]; + << "the crop for dimension " << i + << " is out of bound, first input size " + << input0->dim(i) << ", offset " << offsets[i] + << ", second input size " << input1->dim(i); } } MACE_CHECK(offsets[3] % 4 == 0, "MACE opencl only supports cropping channel" " offset divisible by 4."); - for (index_t i = 0; i < 4; ++i) { - MACE_CHECK(input0->dim(i) - offsets[i] >= input1->dim(i)) - << "the crop for dimension" << i << "is out of bound with size" - << input1->dim(i) << "and offset" << offsets[i]; - } std::vector image_shape; OpenCLUtil::CalImage2DShape(output_shape, OpenCLBufferType::IN_OUT_CHANNEL,