Fix tf.image.central_crop return zero dimension (#12239)
* Fix tf.image.central_crop return zero dimension This fix tries to address the issue raised in 10315 where tf.image.central_crop will return (0, 0, 3) when input is (240, 320, 3). The issue is that the calculation was done by dividing ``` fraction_offset = int(1 / ((1 - central_fraction) / 2.0)) ``` which causes deviation when accuracy is not enough. This fix cast the calculation to double until the last step. This fix fixes 10315. Signed-off-by:Yong Tang <yong.tang.github@outlook.com> * Add test case for tf.image.central_crop return zero dimension This commit adds test case for 10315. Signed-off-by:
Yong Tang <yong.tang.github@outlook.com>
Loading
Please sign in to comment