diff --git a/backends/arm/operators/op_eq.py b/backends/arm/operators/op_eq.py index 02fc89099e0..de49b267641 100644 --- a/backends/arm/operators/op_eq.py +++ b/backends/arm/operators/op_eq.py @@ -34,9 +34,11 @@ def define_node( inputs: List[TosaArg], output: TosaArg, ) -> None: - assert ( - inputs[0].dtype == inputs[1].dtype - ), "EQ must have the same dtypes as input" + if inputs[0].dtype != inputs[1].dtype: + raise TypeError( + "All inputs need to have the same data type for operator EQ but got " + f"{inputs[0].dtype=}, {inputs[1].dtype=}" + ) input_nodes = inputs # Handle quantization diff --git a/backends/arm/operators/op_ge.py b/backends/arm/operators/op_ge.py index e4de12f3327..d18156e1a50 100644 --- a/backends/arm/operators/op_ge.py +++ b/backends/arm/operators/op_ge.py @@ -34,9 +34,11 @@ def define_node( inputs: List[TosaArg], output: TosaArg, ) -> None: - assert ( - inputs[0].dtype == inputs[1].dtype - ), "GE must have the same dtypes as input" + if inputs[0].dtype != inputs[1].dtype: + raise TypeError( + "All inputs need to have the same data type for operator GE but got " + f"{inputs[0].dtype=}, {inputs[1].dtype=}" + ) input_nodes = inputs # Handle quantization diff --git a/backends/arm/operators/op_gt.py b/backends/arm/operators/op_gt.py index 65cf8197bdc..25ff2463c5c 100644 --- a/backends/arm/operators/op_gt.py +++ b/backends/arm/operators/op_gt.py @@ -34,9 +34,11 @@ def define_node( inputs: List[TosaArg], output: TosaArg, ) -> None: - assert ( - inputs[0].dtype == inputs[1].dtype - ), "GT must have the same dtypes as input" + if inputs[0].dtype != inputs[1].dtype: + raise TypeError( + "All inputs need to have the same data type for operator GT but got " + f"{inputs[0].dtype=}, {inputs[1].dtype=}" + ) input_nodes = inputs # Handle quantization diff --git a/backends/arm/operators/op_le.py b/backends/arm/operators/op_le.py index 8fea2b92088..8ed5539034b 100644 --- a/backends/arm/operators/op_le.py +++ b/backends/arm/operators/op_le.py @@ -34,9 +34,11 @@ def define_node( inputs: List[TosaArg], output: TosaArg, ) -> None: - assert ( - inputs[0].dtype == inputs[1].dtype - ), "LE must have the same dtypes as input" + if inputs[0].dtype != inputs[1].dtype: + raise TypeError( + "All inputs need to have the same data type for operator LE but got " + f"{inputs[0].dtype=}, {inputs[1].dtype=}" + ) input_nodes = inputs # Handle quantization diff --git a/backends/arm/operators/op_lt.py b/backends/arm/operators/op_lt.py index da93ab41799..3bb71f611a5 100644 --- a/backends/arm/operators/op_lt.py +++ b/backends/arm/operators/op_lt.py @@ -34,9 +34,11 @@ def define_node( inputs: List[TosaArg], output: TosaArg, ) -> None: - assert ( - inputs[0].dtype == inputs[1].dtype - ), "LT must have the same dtypes as input" + if inputs[0].dtype != inputs[1].dtype: + raise TypeError( + "All inputs need to have the same data type for operator LT but got " + f"{inputs[0].dtype=}, {inputs[1].dtype=}" + ) input_nodes = inputs # Handle quantization