@@ -499,21 +499,16 @@ def Tosa_ClampOp : Tosa_ElementwiseUnaryOp<"clamp"> {
499
499
}
500
500
501
501
//===----------------------------------------------------------------------===//
502
- // Operator: sigmoid
502
+ // Operator: erf
503
503
//===----------------------------------------------------------------------===//
504
- def Tosa_SigmoidOp : Tosa_ElementwiseUnaryOp<"sigmoid "> {
505
- let summary = "Computes elementwise sigmoid of input.";
504
+ def Tosa_ErfOp : Tosa_ElementwiseUnaryOp<"erf "> {
505
+ let summary = "Computes gauss error function of input.";
506
506
507
507
let description = [{
508
- Applies the sigmoid logistic function to each element of the input tensor:
509
- $ sigmoid(x) = \frac{1}{1 + e^{-x}} $.
510
-
511
- For quantized integer data types, the TABLE operator should be used instead.
512
- Each implementation may choose an appropriate TABLE given the scale and zero
513
- point of the input data. Eight or sixteen bit precision tables may be used
514
- based on the input tensor to the sigmoid function. The sigmoid table has 513
515
- entries each of 16-bit precision and covering the input range -16.0 to +16.0
516
- in steps of 1/16.
508
+ Gauss error function: $ erf(x) = \frac{2}{\sqrt{\pi}} \int_{0}^{x} e^{-t^2} dt $
509
+ For quantized integer data types, the TABLE operator should be used instead
510
+ with the following definition. The ERF table has 513 entries each of
511
+ 16-bit precision and covering the input range -4.0 to +4.0 in steps of 1/64.
517
512
}];
518
513
519
514
let arguments = (ins
@@ -528,21 +523,26 @@ def Tosa_SigmoidOp : Tosa_ElementwiseUnaryOp<"sigmoid"> {
528
523
Profile<[Tosa_PRO_FP]>,
529
524
Extension<[Tosa_EXT_BF16]>,
530
525
];
526
+
527
+ let assemblyFormat = "operands attr-dict `:` functional-type(operands, results)";
531
528
}
532
529
533
530
//===----------------------------------------------------------------------===//
534
- // Operator: tanh
531
+ // Operator: sigmoid
535
532
//===----------------------------------------------------------------------===//
536
- def Tosa_TanhOp : Tosa_ElementwiseUnaryOp<"tanh "> {
537
- let summary = "Computes elementwise hyperbolic tangent of input.";
533
+ def Tosa_SigmoidOp : Tosa_ElementwiseUnaryOp<"sigmoid "> {
534
+ let summary = "Computes elementwise sigmoid of input.";
538
535
539
536
let description = [{
540
- Parameterized hyperbolic tangent: $ tanh(x) = \frac{1 - e^{-2x}}{1 + e^{-2x}} $.
537
+ Applies the sigmoid logistic function to each element of the input tensor:
538
+ $ sigmoid(x) = \frac{1}{1 + e^{-x}} $.
541
539
542
540
For quantized integer data types, the TABLE operator should be used instead.
543
541
Each implementation may choose an appropriate TABLE given the scale and zero
544
542
point of the input data. Eight or sixteen bit precision tables may be used
545
- based on the input tensor to the tanh function.
543
+ based on the input tensor to the sigmoid function. The sigmoid table has 513
544
+ entries each of 16-bit precision and covering the input range -16.0 to +16.0
545
+ in steps of 1/16.
546
546
}];
547
547
548
548
let arguments = (ins
@@ -560,16 +560,18 @@ def Tosa_TanhOp : Tosa_ElementwiseUnaryOp<"tanh"> {
560
560
}
561
561
562
562
//===----------------------------------------------------------------------===//
563
- // Operator: erf
563
+ // Operator: tanh
564
564
//===----------------------------------------------------------------------===//
565
- def Tosa_ErfOp : Tosa_ElementwiseUnaryOp<"erf "> {
566
- let summary = "Computes gauss error function of input.";
565
+ def Tosa_TanhOp : Tosa_ElementwiseUnaryOp<"tanh "> {
566
+ let summary = "Computes elementwise hyperbolic tangent of input.";
567
567
568
568
let description = [{
569
- Gauss error function: $ erf(x) = \frac{2}{\sqrt{\pi}} \int_{0}^{x} e^{-t^2} dt $
570
- For quantized integer data types, the TABLE operator should be used instead
571
- with the following definition. The ERF table has 513 entries each of
572
- 16-bit precision and covering the input range -4.0 to +4.0 in steps of 1/64.
569
+ Parameterized hyperbolic tangent: $ tanh(x) = \frac{1 - e^{-2x}}{1 + e^{-2x}} $.
570
+
571
+ For quantized integer data types, the TABLE operator should be used instead.
572
+ Each implementation may choose an appropriate TABLE given the scale and zero
573
+ point of the input data. Eight or sixteen bit precision tables may be used
574
+ based on the input tensor to the tanh function.
573
575
}];
574
576
575
577
let arguments = (ins
@@ -584,8 +586,6 @@ def Tosa_ErfOp : Tosa_ElementwiseUnaryOp<"erf"> {
584
586
Profile<[Tosa_PRO_FP]>,
585
587
Extension<[Tosa_EXT_BF16]>,
586
588
];
587
-
588
- let assemblyFormat = "operands attr-dict `:` functional-type(operands, results)";
589
589
}
590
590
591
591
//===----------------------------------------------------------------------===//
0 commit comments