PReLU#
PReLU operation performs element-wise parametric ReLU operation on a given input tensor, based on the following mathematical formula:
Operation Attributes#
|
Description |
Value Type |
|
|
---|---|---|---|---|
Denotes the data format of the input and output data. |
string |
|
Optional |
|
Denotes whether to apply per_channel broadcast when slope is 1D tensor. |
bool |
|
Optional |
Broadcasting Rules#
Only slope tensor supports broadcasting semantics. Slope tensor is uni-directionally broadcasted to src if one of the following rules is met:
1: slope is 1D tensor and
per_channel_broadcast
is set totrue
, the length of slope tensor is equal to the length of src of channel dimension.2: slope is 1D tensor and
per_channel_broadcast
is set tofalse
, the length of slope tensor is equal to the length of src of the rightmost dimension.3: slope is nD tensor, starting from the rightmost dimension, \(input.shape_i == slope.shape_i\) or \(slope.shape_i == 1\) or slope dimension i is empty.
Execution Arguments#
The inputs and outputs must be provided according to the below index order when constructing an operation.
Inputs#
Index |
Argument Name |
Required or Optional |
---|---|---|
0 |
|
Required |
1 |
|
Required |
Outputs#
Index |
Argument Name |
Required or Optional |
---|---|---|
0 |
|
Required |
Supported Data Types#
PReLU operation supports the following data type combinations.
Src |
Dst |
Slope |
---|---|---|
f32 |
f32 |
f32 |
bf16 |
bf16 |
bf16 |
f16 |
f16 |
f16 |