You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "lhutton1 (via GitHub)" <gi...@apache.org> on 2023/03/28 16:19:23 UTC

[GitHub] [tvm] lhutton1 commented on a diff in pull request #14401: [microNPU] Add support for ResizeNearestNeighbor with half_pixel_centers=True

lhutton1 commented on code in PR #14401:
URL: https://github.com/apache/tvm/pull/14401#discussion_r1150861713


##########
python/tvm/relay/op/contrib/ethosu.py:
##########
@@ -1671,7 +1671,18 @@ def check_compatible_size(mode, method, upscale_size, ifm_size):
             return False
         if self.method not in ("nearest_neighbor", "linear"):
             return False
-        if self.coordinate_transformation_mode not in ("asymmetric", "align_corners"):
+        if self.coordinate_transformation_mode not in (
+            "asymmetric",
+            "align_corners",
+            "half_pixel",
+        ):
+            return False
+        if (
+            self.coordinate_transformation_mode == "half_pixel"
+            and self.rounding_method != "round_prefer_ceil"
+        ):
+            return False
+        if self.coordinate_transformation_mode != "half_pixel" and self.rounding_method != "":

Review Comment:
   Perhaps to avoid confusion we can combine this condition into the previous one as they're related?



##########
tests/python/contrib/test_ethosu/test_codegen.py:
##########
@@ -1084,18 +1084,27 @@ def squeeze_func(x):
 
 
 @pytest.mark.parametrize("accel_type", ACCEL_TYPES)
+@pytest.mark.parametrize("half_pixel", [False, True])

Review Comment:
   This adds quite a few tests due to an extra dimension in the combinations, it's probably better to add `half_pixel` to certain tests in the `ifm_shape,size` parameterization



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org