aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/test/test_supported_operators.py
diff options
context:
space:
mode:
authorerik.andersson@arm.com <erik.andersson@arm.com>2021-02-22 15:47:07 +0100
committererik.andersson@arm.com <erik.andersson@arm.com>2021-02-25 16:30:25 +0100
commit0cbb166cd032c779bd4681afef8097f0831ac8be (patch)
tree662bb70133ecf22a3f9aa52a668150692ce5c06a /ethosu/vela/test/test_supported_operators.py
parent460c689603b6cb713dbad07451278fe208b3f2f6 (diff)
downloadethos-u-vela-0cbb166cd032c779bd4681afef8097f0831ac8be.tar.gz
MLBEDSW-3571: Sum and FC should not crash when asking for keep_dims.
Previously the keep_dims or keep_num_dims attribute was not supported for Sum and Fully Connected operators and would thus crash for certain tests. With this update, the attribute is extracted correctly and saved to the optimised tflite file. Signed-off-by: erik.andersson@arm.com <erik.andersson@arm.com> Change-Id: If33487f6d299bb99788bb3d13332b842ba961641
Diffstat (limited to 'ethosu/vela/test/test_supported_operators.py')
-rw-r--r--ethosu/vela/test/test_supported_operators.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/ethosu/vela/test/test_supported_operators.py b/ethosu/vela/test/test_supported_operators.py
index 6401d29d..832d60fd 100644
--- a/ethosu/vela/test/test_supported_operators.py
+++ b/ethosu/vela/test/test_supported_operators.py
@@ -945,3 +945,11 @@ def test_constraint_hardswish_dtype():
out_tens = Tensor([1, 8, 8, 8], DataType.uint8, "out")
op = testutil.create_op(Op.HardSwish, [in_tens], out_tens)
assert not support.is_operator_supported(op)
+
+
+def test_constraint_keep_dims_ifm_ofm():
+ op = testutil.create_op_with_quant_tensors(Op.FullyConnected, [4, 8, 8, 4], [32, 32], weights_shape=[4, 8, 8, 4])
+ op.attrs["keep_num_dims"] = True
+ assert not support.is_operator_supported(op)
+ op.attrs["keep_num_dims"] = False
+ assert support.is_operator_supported(op)