This is an automated email from the ASF dual-hosted git repository. jwfromm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push: new bdfbc86 fix flaky TF test (#8431) bdfbc86 is described below commit bdfbc862600e3012fcfe66307a5c74f3e94e84f0 Author: Matthew Brookhart <mbrookh...@octoml.ai> AuthorDate: Fri Jul 9 16:59:08 2021 -0600 fix flaky TF test (#8431) --- python/tvm/topi/image/resize.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/python/tvm/topi/image/resize.py b/python/tvm/topi/image/resize.py index 5d9d960..d1abffd 100644 --- a/python/tvm/topi/image/resize.py +++ b/python/tvm/topi/image/resize.py @@ -75,10 +75,9 @@ def get_3d_indices(indices, layout="NCDHW"): return n, c, z, y, x, cc -def get_1d_pixel(data, layout, boxes, image_width, n, c, x, cc, ib, ic): +def get_1d_pixel(data, layout, image_width, n, c, x, cc, ib, ic): """Get 1d pixel""" - if boxes is None: - x = tvm.te.max(tvm.te.min(x, image_width - 1), 0) + x = tvm.te.max(tvm.te.min(x, image_width - 1), 0) if layout == "NWC": return data(n, x, c).astype("float") if layout == "NCW": @@ -91,11 +90,10 @@ def get_1d_pixel(data, layout, boxes, image_width, n, c, x, cc, ib, ic): return data(n, c, x, cc).astype("float") -def get_2d_pixel(data, layout, boxes, image_height, image_width, n, c, y, x, cc, ib, ic): +def get_2d_pixel(data, layout, image_height, image_width, n, c, y, x, cc, ib, ic): """Get 2d pixel""" - if boxes is None: - y = tvm.te.max(tvm.te.min(y, image_height - 1), 0) - x = tvm.te.max(tvm.te.min(x, image_width - 1), 0) + y = tvm.te.max(tvm.te.min(y, image_height - 1), 0) + x = tvm.te.max(tvm.te.min(x, image_width - 1), 0) if layout == "NHWC": return data(n, y, x, c).astype("float") if layout == "NCHW": @@ -288,7 +286,6 @@ def _resize_1d( value = get_1d_pixel( data, layout, - boxes, image_width, box_idx, c, @@ -307,7 +304,6 @@ def _resize_1d( p[i] = get_1d_pixel( data, layout, - boxes, image_width, box_idx, c, @@ -329,7 +325,6 @@ def _resize_1d( p[i] = get_1d_pixel( data, layout, - boxes, image_width, box_idx, c, @@ -576,7 +571,6 @@ def _resize_2d( value = get_2d_pixel( data, layout, - boxes, image_height, image_width, box_idx, @@ -600,7 +594,6 @@ def _resize_2d( p[j][i] = get_2d_pixel( data, layout, - boxes, image_height, image_width, box_idx, @@ -630,7 +623,6 @@ def _resize_2d( p[j][i] = get_2d_pixel( data, layout, - boxes, image_height, image_width, box_idx,