PRelu - 9 vs 16

Next section compares an older to a newer version of the same operator after both definition are converted into markdown text. Green means an addition to the newer version, red means a deletion. Anything else is unchanged.

Files changed (1) hide show
  1. PRelu9 → PRelu16 +20 -1
PRelu9 → PRelu16 RENAMED
@@ -1 +1 @@
1
1
  PRelu takes input data (Tensor<T>) and slope tensor as input, and produces one
2
2
  output data (Tensor<T>) where the function f(x) = slope * x for x < 0,
3
3
  f(x) = x for x >= 0., is applied to the data tensor elementwise.
4
4
  This operator supports **unidirectional broadcasting** (tensor slope should be unidirectional broadcastable to input tensor X); for more details please check [Broadcasting in ONNX](https://github.com/onnx/onnx/blob/main/docs/Broadcasting.md).
5
+
6
+ #### Function Body
7
+
8
+ The function definition for this operator.
9
+
10
+
11
+ <
12
+ domain: "",
13
+ opset_import: ["" : 16]
14
+ >
15
+ PRelu (X, slope) => (Y)
16
+ {
17
+ Zero = Constant <value: tensor = float {0}> ()
18
+ ZeroCast = CastLike (Zero, X)
19
+ XLessThanZero = Less (X, ZeroCast)
20
+ SlopeMulX = Mul (slope, X)
21
+ Y = Where (XLessThanZero, SlopeMulX, X)
22
+ }
23
+
5
24
  ### Inputs
6
25
  - **X** (heterogeneous) - **T**:
7
26
  Input tensor
8
27
  - **slope** (heterogeneous) - **T**:
9
28
  Slope tensor. The shape of slope can be smaller than first input X; if so, its shape must be unidirectional broadcastable to X
10
29
  ### Outputs
11
30
  - **Y** (heterogeneous) - **T**:
12
31
  Output tensor (same size as X)
13
32
  ### Type Constraints
14
- * **T** in ( tensor(double), tensor(float), tensor(float16), tensor(int32), tensor(int64), tensor(uint32), tensor(uint64) ):
33
+ * **T** in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int32), tensor(int64), tensor(uint32), tensor(uint64) ):
15
34
  Constrain input and output types to float/int tensors.