diff options
author | Johan Alfven <johan.alfven@arm.com> | 2023-09-04 17:18:33 +0200 |
---|---|---|
committer | Johan Alfven <johan.alfven@arm.com> | 2023-09-12 13:07:47 +0200 |
commit | c0bb868fe375ff38eede8be363165794ca780978 (patch) | |
tree | c6c1c05695b2f19a3d4e5584e7987e86004683f3 /ethosu/vela/test/test_tflite_supported_operators.py | |
parent | 26c8e8416589f8f76f16f16483bb2d6aad036dfa (diff) | |
download | ethos-u-vela-c0bb868fe375ff38eede8be363165794ca780978.tar.gz |
MLBEDSW-7997: [MLCE] Extended stride support for TRANSPOSE CONV
- Support for stride WxH 1x1
- Support for stride WxH 2x1 when IFM and KERNEL
is 1D shape with height 1
- Added test to supported operators
- Updated SUPPORTED_OPS.md
Change-Id: Ic1abead8399a5e14a78d962f8aded0d3b3dbfcc4
Signed-off-by: Johan Alfven <johan.alfven@arm.com>X
Diffstat (limited to 'ethosu/vela/test/test_tflite_supported_operators.py')
-rw-r--r-- | ethosu/vela/test/test_tflite_supported_operators.py | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/ethosu/vela/test/test_tflite_supported_operators.py b/ethosu/vela/test/test_tflite_supported_operators.py index f54211f0..e5cc280b 100644 --- a/ethosu/vela/test/test_tflite_supported_operators.py +++ b/ethosu/vela/test/test_tflite_supported_operators.py @@ -218,12 +218,47 @@ def test_constraint_depth_multiplier(): def test_constraint_tconv_stride(): - # Strides must be 2 + # Valid 2x2 op = testutil.create_op_with_quant_tensors(Op.Conv2DBackpropInput, [0], [1, 2, 2, 1], weights_shape=[1, 1, 1, 1]) + op.attrs = {"stride_w": 2, "stride_h": 2, "padding": Padding.SAME} + ifm = Tensor([1, 1, 1, 1], DataType.uint8, "ifm") + ifm.quantization = testutil.default_quant_params() + op.add_input_tensor(ifm) + assert support.is_operator_supported(op) + # Valid 1x1 + op = testutil.create_op_with_quant_tensors(Op.Conv2DBackpropInput, [0], [1, 1, 1, 1], weights_shape=[1, 1, 1, 1]) op.attrs = {"stride_w": 1, "stride_h": 1, "padding": Padding.SAME} ifm = Tensor([1, 1, 1, 1], DataType.uint8, "ifm") ifm.quantization = testutil.default_quant_params() op.add_input_tensor(ifm) + assert support.is_operator_supported(op) + # Valid 2x1 (WxH) ifm h and kernel h = 1 + op = testutil.create_op_with_quant_tensors(Op.Conv2DBackpropInput, [0], [1, 1, 2, 1], weights_shape=[1, 1, 1, 1]) + op.attrs = {"stride_w": 2, "stride_h": 1, "padding": Padding.SAME} + ifm = Tensor([1, 1, 1, 1], DataType.uint8, "ifm") + ifm.quantization = testutil.default_quant_params() + op.add_input_tensor(ifm) + assert support.is_operator_supported(op) + # Invalid 2x1 (WxH) ifm h = 2 and kernel h = 1 + op = testutil.create_op_with_quant_tensors(Op.Conv2DBackpropInput, [0], [1, 1, 2, 1], weights_shape=[1, 1, 1, 1]) + op.attrs = {"stride_w": 2, "stride_h": 1, "padding": Padding.SAME} + ifm = Tensor([1, 2, 1, 1], DataType.uint8, "ifm") + ifm.quantization = testutil.default_quant_params() + op.add_input_tensor(ifm) + assert not support.is_operator_supported(op) + # Invalid 2x1 (WxH) ifm h = 1 and kernel h = 2 + op = testutil.create_op_with_quant_tensors(Op.Conv2DBackpropInput, [0], [1, 1, 1, 1], weights_shape=[1, 2, 1, 1]) + op.attrs = {"stride_w": 2, "stride_h": 1, "padding": Padding.SAME} + ifm = Tensor([1, 2, 1, 1], DataType.uint8, "ifm") + ifm.quantization = testutil.default_quant_params() + op.add_input_tensor(ifm) + assert not support.is_operator_supported(op) + # Invalid 1x2 (WxH) + op = testutil.create_op_with_quant_tensors(Op.Conv2DBackpropInput, [0], [1, 1, 1, 1], weights_shape=[1, 1, 1, 1]) + op.attrs = {"stride_w": 1, "stride_h": 2, "padding": Padding.SAME} + ifm = Tensor([1, 1, 1, 1], DataType.uint8, "ifm") + ifm.quantization = testutil.default_quant_params() + op.add_input_tensor(ifm) assert not support.is_operator_supported(op) |