File tree 5 files changed +25
-15
lines changed 5 files changed +25
-15
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,11 @@ def define_node(
34
34
inputs : List [TosaArg ],
35
35
output : TosaArg ,
36
36
) -> None :
37
- assert (
38
- inputs [0 ].dtype == inputs [1 ].dtype
39
- ), "EQ must have the same dtypes as input"
37
+ if inputs [0 ].dtype != inputs [1 ].dtype :
38
+ raise TypeError (
39
+ "All inputs need to have the same data type for operator EQ but got "
40
+ f"{ inputs [0 ].dtype = } , { inputs [1 ].dtype = } "
41
+ )
40
42
41
43
input_nodes = inputs
42
44
# Handle quantization
Original file line number Diff line number Diff line change @@ -34,9 +34,11 @@ def define_node(
34
34
inputs : List [TosaArg ],
35
35
output : TosaArg ,
36
36
) -> None :
37
- assert (
38
- inputs [0 ].dtype == inputs [1 ].dtype
39
- ), "GE must have the same dtypes as input"
37
+ if inputs [0 ].dtype != inputs [1 ].dtype :
38
+ raise TypeError (
39
+ "All inputs need to have the same data type for operator GE but got "
40
+ f"{ inputs [0 ].dtype = } , { inputs [1 ].dtype = } "
41
+ )
40
42
41
43
input_nodes = inputs
42
44
# Handle quantization
Original file line number Diff line number Diff line change @@ -34,9 +34,11 @@ def define_node(
34
34
inputs : List [TosaArg ],
35
35
output : TosaArg ,
36
36
) -> None :
37
- assert (
38
- inputs [0 ].dtype == inputs [1 ].dtype
39
- ), "GT must have the same dtypes as input"
37
+ if inputs [0 ].dtype != inputs [1 ].dtype :
38
+ raise TypeError (
39
+ "All inputs need to have the same data type for operator GT but got "
40
+ f"{ inputs [0 ].dtype = } , { inputs [1 ].dtype = } "
41
+ )
40
42
41
43
input_nodes = inputs
42
44
# Handle quantization
Original file line number Diff line number Diff line change @@ -34,9 +34,11 @@ def define_node(
34
34
inputs : List [TosaArg ],
35
35
output : TosaArg ,
36
36
) -> None :
37
- assert (
38
- inputs [0 ].dtype == inputs [1 ].dtype
39
- ), "LE must have the same dtypes as input"
37
+ if inputs [0 ].dtype != inputs [1 ].dtype :
38
+ raise TypeError (
39
+ "All inputs need to have the same data type for operator LE but got "
40
+ f"{ inputs [0 ].dtype = } , { inputs [1 ].dtype = } "
41
+ )
40
42
41
43
input_nodes = inputs
42
44
# Handle quantization
Original file line number Diff line number Diff line change @@ -34,9 +34,11 @@ def define_node(
34
34
inputs : List [TosaArg ],
35
35
output : TosaArg ,
36
36
) -> None :
37
- assert (
38
- inputs [0 ].dtype == inputs [1 ].dtype
39
- ), "LT must have the same dtypes as input"
37
+ if inputs [0 ].dtype != inputs [1 ].dtype :
38
+ raise TypeError (
39
+ "All inputs need to have the same data type for operator LT but got "
40
+ f"{ inputs [0 ].dtype = } , { inputs [1 ].dtype = } "
41
+ )
40
42
41
43
input_nodes = inputs
42
44
# Handle quantization
You can’t perform that action at this time.
0 commit comments