diff options
author | Alexander Hansson <Alexander.Hansson@arm.com> | 2023-05-11 16:01:39 +0000 |
---|---|---|
committer | Alexander Hansson <alexander.hansson@arm.com> | 2023-05-17 15:13:29 +0100 |
commit | e8fc214481bdbe1c80613b3f3a471c135038560e (patch) | |
tree | 72e7b7c49ed4032da486950c1e62f3ad5328f852 /ethosu | |
parent | 2466d81337c787b9e9dc01a11f11d5468c7567f5 (diff) | |
download | ethos-u-vela-e8fc214481bdbe1c80613b3f3a471c135038560e.tar.gz |
MLBEDSW-7230: Increase support for 1x1 ResizeBilinear with half_pixel_center=True
Signed-off-by: Alexander Hansson <Alexander.Hansson@arm.com>
Change-Id: I0e9db22c97a9e2fbfee618262ffc43532cfcee2c
Diffstat (limited to 'ethosu')
-rw-r--r-- | ethosu/vela/tflite_supported_operators.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ethosu/vela/tflite_supported_operators.py b/ethosu/vela/tflite_supported_operators.py index 8e9ab12f..396fbc23 100644 --- a/ethosu/vela/tflite_supported_operators.py +++ b/ethosu/vela/tflite_supported_operators.py @@ -708,14 +708,20 @@ class TFLiteSupportedOperators: @staticmethod def constraint_resizebi_half_pixel_centers_dims(op): - """Half_pixel_centers for resize bilinear requires that OFM W and H is 2x IFM W and H""" + """Half_pixel_centers for resize bilinear requires that the width + and height of the IFM and OFM must match one of the following criteria: + IFM W and H are both 1 + OFM W and H is 2x IFM W and H""" half_pixel_centers = op.attrs.get("half_pixel_centers", False) if not half_pixel_centers: valid = True elif len(op.ifm.shape) >= 3: ifm_h, ifm_w = op.ifm.shape[-3:-1] ofm_h, ofm_w = op.ofm.shape[-3:-1] - valid = ofm_h / ifm_h == 2 and ofm_w / ifm_w == 2 + if ifm_h == 1 and ifm_w == 1: + valid = True + else: + valid = ofm_h / ifm_h == 2 and ofm_w / ifm_w == 2 else: # Unexpected IFM shape valid = False |