Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyag-grovety committed Apr 4, 2023
1 parent 624b5d2 commit 500c63d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions python/tvm/relay/op/contrib/ethosu.py
Original file line number Diff line number Diff line change
Expand Up @@ -1680,10 +1680,10 @@ def check_compatible_size(mode, method, upscale_size, ifm_size):
if (
self.coordinate_transformation_mode == "half_pixel"
and self.rounding_method != "round_prefer_ceil"
or self.coordinate_transformation_mode != "half_pixel"
and self.rounding_method != ""
):
return False
if self.coordinate_transformation_mode != "half_pixel" and self.rounding_method != "":
return False
if not check_compatible_size(
self.coordinate_transformation_mode,
self.method,
Expand Down
13 changes: 7 additions & 6 deletions tests/python/contrib/test_ethosu/test_codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,14 +1084,15 @@ def squeeze_func(x):


@pytest.mark.parametrize("accel_type", ACCEL_TYPES)
@pytest.mark.parametrize("half_pixel", [False, True])
@pytest.mark.parametrize(
"ifm_shape,size",
"ifm_shape,size,half_pixel",
[
[(1, 2, 2, 1), (4, 4)],
[(1, 4, 7, 3), (8, 14)],
[(1, 3, 5, 3), (3, 5)],
[(1, 6, 6, 96), (12, 12)],
[(1, 2, 2, 1), (4, 4), False],
[(1, 2, 2, 1), (4, 4), True],
[(1, 4, 7, 3), (8, 14), False],
[(1, 3, 5, 3), (3, 5), False],
[(1, 6, 6, 96), (12, 12), False],
[(1, 6, 6, 96), (12, 12), True],
],
)
def test_tflite_resize2d_nearest_neighbor(accel_type, ifm_shape, size, half_pixel):
Expand Down
13 changes: 7 additions & 6 deletions tests/python/contrib/test_ethosu/test_legalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -2341,14 +2341,15 @@ def verify(ext_func):
verify(mod["tvmgen_default_ethos_u_main_0"])


@pytest.mark.parametrize("half_pixel", [False, True])
@pytest.mark.parametrize(
"ifm_shape,size",
"ifm_shape,size,half_pixel",
[
[(1, 2, 2, 1), (4, 4)],
[(1, 4, 7, 3), (8, 14)],
[(1, 3, 5, 3), (3, 5)],
[(1, 6, 6, 96), (12, 12)],
[(1, 2, 2, 1), (4, 4), False],
[(1, 2, 2, 1), (4, 4), True],
[(1, 4, 7, 3), (8, 14), False],
[(1, 3, 5, 3), (3, 5), False],
[(1, 6, 6, 96), (12, 12), False],
[(1, 6, 6, 96), (12, 12), True],
],
)
def test_tflite_resize2d_nearest_neighbor(ifm_shape, size, half_pixel):
Expand Down

0 comments on commit 500c63d

Please sign in to comment.