提交 127df21d 编写于 作者: 叶剑武

Merge branch 'fix-crop-check' into 'master'

Fix wrong checking in crop OpenCL kernel.

See merge request !1081
......@@ -71,18 +71,15 @@ MaceStatus CropKernel<T>::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<size_t> image_shape;
OpenCLUtil::CalImage2DShape(output_shape,
OpenCLBufferType::IN_OUT_CHANNEL,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册