aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/tflite_supported_operators.py
diff options
context:
space:
mode:
authorJohan Alfvén <johan.alfven@arm.com>2022-10-27 16:30:01 +0200
committerTim Hall <tim.hall@arm.com>2022-11-03 16:35:22 +0000
commit9d51ec41855a8be21bd0708c882d121e5bb5afcc (patch)
tree69d5fa0d2da78c9df2ccc0999756b4a9e8368901 /ethosu/vela/tflite_supported_operators.py
parent92cd33b7adbb799b6593d49f1d29c13a85933e55 (diff)
downloadethos-u-vela-9d51ec41855a8be21bd0708c882d121e5bb5afcc.tar.gz
MLBEDSW-7074: Updated reference kernel for the MEAN op
The reference kernel for the MEAN operator has changed. As a result, the mean implementation can be simplified and the constraint for mean int8 can be removed. Signed-off-by: Johan Alfven <johan.alfven@arm.com> Change-Id: I318e9b495eefea99e7ac4aea4b8c436c83753405
Diffstat (limited to 'ethosu/vela/tflite_supported_operators.py')
-rw-r--r--ethosu/vela/tflite_supported_operators.py27
1 files changed, 0 insertions, 27 deletions
diff --git a/ethosu/vela/tflite_supported_operators.py b/ethosu/vela/tflite_supported_operators.py
index b8fe4b6a..fd8bbeef 100644
--- a/ethosu/vela/tflite_supported_operators.py
+++ b/ethosu/vela/tflite_supported_operators.py
@@ -197,7 +197,6 @@ class TFLiteSupportedOperators:
filter_height_range = (1, 256)
filter_product_range = (1, 256 * 256)
mean_kernel_product = 64 * 64
- mean_kernel_product_int8 = 16 * 16
mean_kernel_product_avgpool = 256 * 256
def __init__(self):
@@ -314,7 +313,6 @@ class TFLiteSupportedOperators:
# Mean specific checks:
self.specific_constraints[Op.Mean].append(TFLiteSupportedOperators.constraint_mean_height_width_product_avgpool)
self.specific_constraints[Op.Mean].append(TFLiteSupportedOperators.constraint_mean_height_width_product)
- self.specific_constraints[Op.Mean].append(TFLiteSupportedOperators.constraint_mean_height_width_product_int8)
self.specific_constraints[Op.Mean].append(TFLiteSupportedOperators.constraint_mean_height_single_axis)
# Reshape specific checks:
@@ -810,31 +808,6 @@ class TFLiteSupportedOperators:
return h * w <= max_prod, f"Product of height and width is {h * w}"
@classmethod
- @docstring_format_args([mean_kernel_product_int8])
- def constraint_mean_height_width_product_int8(cls, op):
- """Product of IFM height and width must be no greater than {} when:
- The IFM shape has 4 dimensions; and
- The axis indices specify reduction across 2 dimensions; and
- The axis indices correspond to the width and height dimensions of the IFM; and
- 'keep_dims' is True; and
- IFM datatype is int8"""
- shape = op.ifm.shape
- axis = int(op.inputs[1].values) if op.inputs[1].shape == [] else list(op.inputs[1].values)
- # doesn't apply, size is checked by constraint_mean_height_width_product_avgpool
- # and constraint_mean_height_width_product
- if (
- len(shape) != 4
- or op.ifm.dtype != DataType.int8
- or not op.attrs.get("keep_dims")
- or axis not in ([1, 2], [2, 1])
- ):
- return True, ""
- h = shape[-3]
- w = shape[-2]
- max_prod = cls.mean_kernel_product_int8
- return h * w <= max_prod, f"Product of height and width is {h * w}"
-
- @classmethod
@docstring_format_args([filter_height_range[1], dilated_height_range[1]])
def constraint_mean_height_single_axis(cls, op):
"""For single axis averages across the height dimension: