masahi commented on a change in pull request #6298:
URL: https://github.com/apache/incubator-tvm/pull/6298#discussion_r472645934



##########
File path: python/tvm/topi/image/resize.py
##########
@@ -529,8 +529,12 @@ def resize(data, size, layout="NCHW", method="bilinear",
         or [batch, in_height*scale, in_width*scale, channel]
         or 5-D with shape [batch, channel-major, in_height*scale, 
in_width*scale, channel-minor]
     """
-
     method = method.lower()
+    if ((method == "nearest_neighbor" and coordinate_transformation_mode == 
"align_corners") or 
+            (method == "bilinear" and coordinate_transformation_mode != 
"align_corners")):
+        raise ValueError('Topi Resize does not support the combination of 
method %s ' \
+                         'and coordinate_transformation_mode %s' %
+                         (method, coordinate_transformation_mode))

Review comment:
       Bilinear + half_pixel should work fine. I guess you are not passing the 
`half_pixel` option to the reference function here
   
https://github.com/apache/incubator-tvm/blob/master/tests/python/relay/test_op_level5.py#L52
   
   See 
https://github.com/apache/incubator-tvm/blob/0a4ee30da727ae1566a0541ba6ed726d48733cc7/python/tvm/topi/testing/bilinear_resize_python.py#L23




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to