MLBEDSW-7072: Added bias shape constraint

- Only 1D bias shape is supported
- Modified test to reflect the constraint
- Update SUPPORTED_OPS.md

Signed-off-by: Johan Alfven <johan.alfven@arm.com>
Change-Id: I00ae4b229d5f89512cb94f87f276af61cc66a6fd
diff --git a/SUPPORTED_OPS.md b/SUPPORTED_OPS.md
index e74a29f..cee25e7 100644
--- a/SUPPORTED_OPS.md
+++ b/SUPPORTED_OPS.md
@@ -1,7 +1,7 @@
 # Supported Ops
 
 This file was automatically generated by Vela using the `--supported-ops-report` parameter.  
-Vela version: `3.6.0`
+Vela version: `3.6.1.dev1+g30e5320.d20221207`
 
 This file complies with
 [**Gitiles Markdown syntax**](https://github.com/google/gitiles/blob/master/Documentation/markdown.md)
@@ -129,6 +129,7 @@
 - Weight tensor must be 8-bit
 - Weight tensor must be constant
 - The sum of the weights cannot exceed 8323072
+- Optional Bias tensor must be of shape: 1D
 - Optional Bias tensor must be of type: int32, int64
 - Optional Bias tensor values must fit within 40-bits
 
@@ -144,6 +145,7 @@
 - Weight tensor must be 8-bit
 - Weight tensor must be constant
 - The sum of the weights cannot exceed 8323072
+- Optional Bias tensor must be of shape: 1D
 - Optional Bias tensor must be of type: int32, int64
 - Optional Bias tensor values must fit within 40-bits
 - For depth multipliers > 1, IFM channels must be 1 and OFM channels must be equal to the depth multiplier
@@ -162,6 +164,7 @@
 - The IFM and OFM must have the same number of dimensions if keep_num_dims is set to true
 - Weight tensor must be 8-bit
 - Weight tensor must be constant
+- Optional Bias tensor must be of shape: 1D
 - Optional Bias tensor must be of type: int32, int64
 - Optional Bias tensor values must fit within 40-bits
 
@@ -326,6 +329,7 @@
 - Weight tensor must be 8-bit
 - Weight tensor must be constant
 - The sum of the weights cannot exceed 8323072
+- Optional Bias tensor must be of shape: 1D
 - Optional Bias tensor must be of type: int32, int64
 - Optional Bias tensor values must fit within 40-bits
 - Stride values for both width and height must be 2
diff --git a/ethosu/vela/test/test_tflite_supported_operators.py b/ethosu/vela/test/test_tflite_supported_operators.py
index d9b241f..d091531 100644
--- a/ethosu/vela/test/test_tflite_supported_operators.py
+++ b/ethosu/vela/test/test_tflite_supported_operators.py
@@ -62,7 +62,7 @@
 
 def test_constraint_tens_quant_per_axis_is_supp():
     op = testutil.create_op_with_quant_tensors(
-        Op.Conv2DBias, [1, 1, 1, 3], [1, 1, 1, 3], weights_shape=[1, 1, 1, 3], bias_shape=[1, 1, 1, 3]
+        Op.Conv2DBias, [1, 1, 1, 3], [1, 1, 1, 3], weights_shape=[1, 1, 1, 3], bias_shape=[3]
     )
     op.attrs = {"stride_w": 1, "stride_h": 1}
     assert support.is_operator_supported(op)
diff --git a/ethosu/vela/tflite_supported_operators.py b/ethosu/vela/tflite_supported_operators.py
index aabe813..ea39b47 100644
--- a/ethosu/vela/tflite_supported_operators.py
+++ b/ethosu/vela/tflite_supported_operators.py
@@ -234,6 +234,7 @@
             self.specific_constraints[op_type].append(TFLiteSupportedOperators.constraint_weights_type)
             self.specific_constraints[op_type].append(TFLiteSupportedOperators.constraint_weights_const)
             self.specific_constraints[op_type].append(TFLiteSupportedOperators.constraint_weights_limit)
+            self.specific_constraints[op_type].append(TFLiteSupportedOperators.constraint_bias_shape)
             self.specific_constraints[op_type].append(TFLiteSupportedOperators.constraint_bias_type)
             self.specific_constraints[op_type].append(TFLiteSupportedOperators.constraint_bias_40bit)
         # Transpose Conv specific checks:
@@ -275,6 +276,7 @@
         for op_type in TFLiteSupportedOperators.fc_vector_products:
             self.specific_constraints[op_type].append(TFLiteSupportedOperators.constraint_weights_type)
             self.specific_constraints[op_type].append(TFLiteSupportedOperators.constraint_weights_const)
+            self.specific_constraints[op_type].append(TFLiteSupportedOperators.constraint_bias_shape)
             self.specific_constraints[op_type].append(TFLiteSupportedOperators.constraint_bias_type)
             self.specific_constraints[op_type].append(TFLiteSupportedOperators.constraint_bias_40bit)
 
@@ -474,6 +476,15 @@
         valid = limit <= cls.weights_limit
         return valid, f"Tensor '{weights.name}' has the sum of weights: {limit}"
 
+    @staticmethod
+    def constraint_bias_shape(op):
+        "Optional Bias tensor must be of shape: 1D"
+        bias = op.bias
+        if bias:
+            valid = len(bias.shape) == 1
+            return valid, f"Tensor '{bias.name}' has shape: {bias.shape}"
+        return True, "Op has no bias tensor"
+
     @classmethod
     @docstring_format_args([list_formatter(supported_bias_dtypes)])
     def constraint_bias_type(cls, op):