@@ -367,7 +367,7 @@ def Tosa_TransposeConv2DOp : Tosa_InferShapedTypeOp<"transpose_conv2d"> {
367
367
//===----------------------------------------------------------------------===//
368
368
// Operator: clamp
369
369
//===----------------------------------------------------------------------===//
370
- def Tosa_ClampOp : Tosa_ElementwiseOp <"clamp"> {
370
+ def Tosa_ClampOp : Tosa_ElementwiseUnaryOp <"clamp"> {
371
371
let summary = "Computes clamp(features, min, max).";
372
372
373
373
let description = [{
@@ -397,7 +397,7 @@ def Tosa_ClampOp : Tosa_ElementwiseOp<"clamp"> {
397
397
//===----------------------------------------------------------------------===//
398
398
// Operator: sigmoid
399
399
//===----------------------------------------------------------------------===//
400
- def Tosa_SigmoidOp : Tosa_ElementwiseOp <"sigmoid"> {
400
+ def Tosa_SigmoidOp : Tosa_ElementwiseUnaryOp <"sigmoid"> {
401
401
let summary = "Computes elementwise sigmoid of input.";
402
402
403
403
let description = [{
@@ -420,7 +420,7 @@ def Tosa_SigmoidOp : Tosa_ElementwiseOp<"sigmoid"> {
420
420
//===----------------------------------------------------------------------===//
421
421
// Operator: tanh
422
422
//===----------------------------------------------------------------------===//
423
- def Tosa_TanhOp : Tosa_ElementwiseOp <"tanh", [SameOperandsAndResultElementType] > {
423
+ def Tosa_TanhOp : Tosa_ElementwiseUnaryOp <"tanh"> {
424
424
let summary = "Computes elementwise hyperbolic tangent of input";
425
425
426
426
let description = [{
@@ -442,10 +442,7 @@ def Tosa_TanhOp : Tosa_ElementwiseOp<"tanh", [SameOperandsAndResultElementType]>
442
442
//===----------------------------------------------------------------------===//
443
443
// Operator: erf
444
444
//===----------------------------------------------------------------------===//
445
- def Tosa_ErfOp : Tosa_Op<"erf", [
446
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
447
- ["inferReturnTypeComponents"]>,
448
- Pure]> {
445
+ def Tosa_ErfOp : Tosa_ElementwiseUnaryOp<"erf"> {
449
446
let summary = "Computes gauss error function of input";
450
447
451
448
let description = [{
@@ -906,7 +903,7 @@ def Tosa_TableOp : Tosa_InferShapedTypeOp<"table"> {
906
903
//===----------------------------------------------------------------------===//
907
904
// Operator: abs
908
905
//===----------------------------------------------------------------------===//
909
- def Tosa_AbsOp : Tosa_ElementwiseOp <"abs", [SameOperandsAndResultElementType] > {
906
+ def Tosa_AbsOp : Tosa_ElementwiseUnaryOp <"abs"> {
910
907
let summary = "Elementwise abs op";
911
908
912
909
let description = [{
@@ -933,8 +930,7 @@ def Tosa_AbsOp : Tosa_ElementwiseOp<"abs", [SameOperandsAndResultElementType]> {
933
930
//===----------------------------------------------------------------------===//
934
931
// Operator: bitwise_not
935
932
//===----------------------------------------------------------------------===//
936
- def Tosa_BitwiseNotOp : Tosa_ElementwiseOp<"bitwise_not",
937
- [SameOperandsAndResultElementType]> {
933
+ def Tosa_BitwiseNotOp : Tosa_ElementwiseUnaryOp<"bitwise_not"> {
938
934
let summary = "Bitwise NOT operator";
939
935
940
936
let description = [{
@@ -953,7 +949,7 @@ def Tosa_BitwiseNotOp : Tosa_ElementwiseOp<"bitwise_not",
953
949
//===----------------------------------------------------------------------===//
954
950
// Operator: ceil
955
951
//===----------------------------------------------------------------------===//
956
- def Tosa_CeilOp : Tosa_ElementwiseOp <"ceil", [SameOperandsAndResultElementType] > {
952
+ def Tosa_CeilOp : Tosa_ElementwiseUnaryOp <"ceil"> {
957
953
let summary = "Elementwise ceil op";
958
954
959
955
let description = [{
@@ -972,7 +968,7 @@ def Tosa_CeilOp : Tosa_ElementwiseOp<"ceil", [SameOperandsAndResultElementType]>
972
968
//===----------------------------------------------------------------------===//
973
969
// Operator: clz
974
970
//===----------------------------------------------------------------------===//
975
- def Tosa_ClzOp : Tosa_ElementwiseOp <"clz", [SameOperandsAndResultElementType] > {
971
+ def Tosa_ClzOp : Tosa_ElementwiseUnaryOp <"clz"> {
976
972
let summary = "Elementwise count leading zero op";
977
973
978
974
let description = [{
@@ -991,8 +987,7 @@ def Tosa_ClzOp : Tosa_ElementwiseOp<"clz", [SameOperandsAndResultElementType]> {
991
987
//===----------------------------------------------------------------------===//
992
988
// Operator: cos
993
989
//===----------------------------------------------------------------------===//
994
- def Tosa_CosOp : Tosa_ElementwiseOp<"cos",
995
- [SameOperandsAndResultElementType]> {
990
+ def Tosa_CosOp : Tosa_ElementwiseUnaryOp<"cos"> {
996
991
let summary = "Elementwise cos op";
997
992
998
993
let description = [{
@@ -1011,7 +1006,7 @@ def Tosa_CosOp : Tosa_ElementwiseOp<"cos",
1011
1006
//===----------------------------------------------------------------------===//
1012
1007
// Operator: exp
1013
1008
//===----------------------------------------------------------------------===//
1014
- def Tosa_ExpOp : Tosa_ElementwiseOp <"exp", [SameOperandsAndResultElementType] > {
1009
+ def Tosa_ExpOp : Tosa_ElementwiseUnaryOp <"exp"> {
1015
1010
let summary = "Elementwise exp op";
1016
1011
1017
1012
let description = [{
@@ -1032,7 +1027,7 @@ def Tosa_ExpOp : Tosa_ElementwiseOp<"exp", [SameOperandsAndResultElementType]> {
1032
1027
//===----------------------------------------------------------------------===//
1033
1028
// Operator: floor
1034
1029
//===----------------------------------------------------------------------===//
1035
- def Tosa_FloorOp : Tosa_ElementwiseOp <"floor", [SameOperandsAndResultElementType] > {
1030
+ def Tosa_FloorOp : Tosa_ElementwiseUnaryOp <"floor"> {
1036
1031
let summary = "Elementwise floor op";
1037
1032
1038
1033
let description = [{
@@ -1051,7 +1046,7 @@ def Tosa_FloorOp : Tosa_ElementwiseOp<"floor", [SameOperandsAndResultElementType
1051
1046
//===----------------------------------------------------------------------===//
1052
1047
// Operator: log
1053
1048
//===----------------------------------------------------------------------===//
1054
- def Tosa_LogOp : Tosa_ElementwiseOp <"log", [SameOperandsAndResultElementType] > {
1049
+ def Tosa_LogOp : Tosa_ElementwiseUnaryOp <"log"> {
1055
1050
let summary = "Elementwise log op";
1056
1051
1057
1052
let description = [{
@@ -1072,8 +1067,7 @@ def Tosa_LogOp : Tosa_ElementwiseOp<"log", [SameOperandsAndResultElementType]> {
1072
1067
//===----------------------------------------------------------------------===//
1073
1068
// Operator: logical_not
1074
1069
//===----------------------------------------------------------------------===//
1075
- def Tosa_LogicalNotOp : Tosa_ElementwiseOp<"logical_not",
1076
- [SameOperandsAndResultElementType]> {
1070
+ def Tosa_LogicalNotOp : Tosa_ElementwiseUnaryOp<"logical_not"> {
1077
1071
let summary = "Returns the truth value of NOT x element-wise.";
1078
1072
1079
1073
let description = [{
@@ -1092,8 +1086,7 @@ def Tosa_LogicalNotOp : Tosa_ElementwiseOp<"logical_not",
1092
1086
//===----------------------------------------------------------------------===//
1093
1087
// Operator: negate
1094
1088
//===----------------------------------------------------------------------===//
1095
- def Tosa_NegateOp : Tosa_ElementwiseOp<"negate",
1096
- [SameOperandsAndResultElementType]> {
1089
+ def Tosa_NegateOp : Tosa_ElementwiseUnaryOp<"negate"> {
1097
1090
let summary = "Elementwise negate op";
1098
1091
1099
1092
let description = [{
@@ -1117,8 +1110,7 @@ def Tosa_NegateOp : Tosa_ElementwiseOp<"negate",
1117
1110
//===----------------------------------------------------------------------===//
1118
1111
// Operator: reciprocal
1119
1112
//===----------------------------------------------------------------------===//
1120
- def Tosa_ReciprocalOp : Tosa_ElementwiseOp<"reciprocal",
1121
- [SameOperandsAndResultElementType]> {
1113
+ def Tosa_ReciprocalOp : Tosa_ElementwiseUnaryOp<"reciprocal"> {
1122
1114
let summary = "Elementwise reciprocal op";
1123
1115
1124
1116
let description = [{
@@ -1149,8 +1141,7 @@ def Tosa_ReciprocalOp : Tosa_ElementwiseOp<"reciprocal",
1149
1141
//===----------------------------------------------------------------------===//
1150
1142
// Operator: rsqrt
1151
1143
//===----------------------------------------------------------------------===//
1152
- def Tosa_RsqrtOp : Tosa_ElementwiseOp<"rsqrt",
1153
- [SameOperandsAndResultElementType]> {
1144
+ def Tosa_RsqrtOp : Tosa_ElementwiseUnaryOp<"rsqrt"> {
1154
1145
let summary = "Elementwise 1/sqrt op";
1155
1146
1156
1147
let description = [{
@@ -1170,8 +1161,7 @@ def Tosa_RsqrtOp : Tosa_ElementwiseOp<"rsqrt",
1170
1161
//===----------------------------------------------------------------------===//
1171
1162
// Operator: sin
1172
1163
//===----------------------------------------------------------------------===//
1173
- def Tosa_SinOp : Tosa_ElementwiseOp<"sin",
1174
- [SameOperandsAndResultElementType]> {
1164
+ def Tosa_SinOp : Tosa_ElementwiseUnaryOp<"sin"> {
1175
1165
let summary = "Elementwise sin op";
1176
1166
1177
1167
let description = [{
0 commit comments