(l-onnx-doc-PRelu)= # PRelu (l-onnx-op-prelu-16)= ## PRelu - 16 ### Version - **name**: [PRelu (GitHub)](https://github.com/onnx/onnx/blob/main/docs/Operators.md#PRelu) - **domain**: `main` - **since_version**: `16` - **function**: `True` - **support_level**: `SupportType.COMMON` - **shape inference**: `True` This version of the operator has been available **since version 16**. ### Summary PRelu takes input data (Tensor) and slope tensor as input, and produces one output data (Tensor) where the function `f(x) = slope * x for x < 0`, `f(x) = x for x >= 0`., is applied to the data tensor elementwise. 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). #### Function Body The function definition for this operator. ``` < domain: "", opset_import: ["" : 16] > PRelu (X, slope) => (Y) { Zero = Constant () ZeroCast = CastLike (Zero, X) XLessThanZero = Less (X, ZeroCast) SlopeMulX = Mul (slope, X) Y = Where (XLessThanZero, SlopeMulX, X) } ``` ### Inputs - **X** (heterogeneous) - **T**: Input tensor - **slope** (heterogeneous) - **T**: Slope tensor. The shape of slope can be smaller than first input X; if so, its shape must be unidirectional broadcastable to X ### Outputs - **Y** (heterogeneous) - **T**: Output tensor (same size as X) ### Type Constraints * **T** in ( `tensor(bfloat16)`, `tensor(double)`, `tensor(float)`, `tensor(float16)`, `tensor(int32)`, `tensor(int64)`, `tensor(uint32)`, `tensor(uint64)` ): Constrain input and output types to float/int tensors. ```{toctree} text_diff_PRelu_9_16 ``` (l-onnx-op-prelu-9)= ## PRelu - 9 ### Version - **name**: [PRelu (GitHub)](https://github.com/onnx/onnx/blob/main/docs/Operators.md#PRelu) - **domain**: `main` - **since_version**: `9` - **function**: `False` - **support_level**: `SupportType.COMMON` - **shape inference**: `True` This version of the operator has been available **since version 9**. ### Summary PRelu takes input data (Tensor) and slope tensor as input, and produces one output data (Tensor) where the function `f(x) = slope * x for x < 0`, `f(x) = x for x >= 0`., is applied to the data tensor elementwise. 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). ### Inputs - **X** (heterogeneous) - **T**: Input tensor - **slope** (heterogeneous) - **T**: Slope tensor. The shape of slope can be smaller than first input X; if so, its shape must be unidirectional broadcastable to X ### Outputs - **Y** (heterogeneous) - **T**: Output tensor (same size as X) ### Type Constraints * **T** in ( `tensor(double)`, `tensor(float)`, `tensor(float16)`, `tensor(int32)`, `tensor(int64)`, `tensor(uint32)`, `tensor(uint64)` ): Constrain input and output types to float/int tensors. ```{toctree} text_diff_PRelu_7_16 text_diff_PRelu_7_9 ``` (l-onnx-op-prelu-7)= ## PRelu - 7 ### Version - **name**: [PRelu (GitHub)](https://github.com/onnx/onnx/blob/main/docs/Operators.md#PRelu) - **domain**: `main` - **since_version**: `7` - **function**: `False` - **support_level**: `SupportType.COMMON` - **shape inference**: `True` This version of the operator has been available **since version 7**. ### Summary PRelu takes input data (Tensor) and slope tensor as input, and produces one output data (Tensor) where the function `f(x) = slope * x for x < 0`, `f(x) = x for x >= 0`., is applied to the data tensor elementwise. 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). ### Inputs - **X** (heterogeneous) - **T**: Input tensor - **slope** (heterogeneous) - **T**: Slope tensor. The shape of slope can be smaller than first input X; if so, its shape must be unidirectional broadcastable to X ### Outputs - **Y** (heterogeneous) - **T**: Output tensor (same size as X) ### Type Constraints * **T** in ( `tensor(double)`, `tensor(float)`, `tensor(float16)` ): Constrain input and output types to float tensors. ```{toctree} text_diff_PRelu_6_16 text_diff_PRelu_6_9 text_diff_PRelu_6_7 ``` (l-onnx-op-prelu-6)= ## PRelu - 6 ### Version - **name**: [PRelu (GitHub)](https://github.com/onnx/onnx/blob/main/docs/Operators.md#PRelu) - **domain**: `main` - **since_version**: `6` - **function**: `False` - **support_level**: `SupportType.COMMON` - **shape inference**: `True` This version of the operator has been available **since version 6**. ### Summary PRelu takes input data (Tensor) and slope tensor as input, and produces one output data (Tensor) where the function `f(x) = slope * x for x < 0`, `f(x) = x for x >= 0`., is applied to the data tensor elementwise. ### Inputs - **X** (heterogeneous) - **T**: Input tensor - **slope** (heterogeneous) - **T**: Slope tensor. If `Slope` is of size 1, the value is sharedacross different channels ### Outputs - **Y** (heterogeneous) - **T**: Output tensor ### Type Constraints * **T** in ( `tensor(double)`, `tensor(float)`, `tensor(float16)` ): Constrain input and output types to float tensors. ```{toctree} text_diff_PRelu_1_16 text_diff_PRelu_1_9 text_diff_PRelu_1_7 text_diff_PRelu_1_6 ``` (l-onnx-op-prelu-1)= ## PRelu - 1 ### Version - **name**: [PRelu (GitHub)](https://github.com/onnx/onnx/blob/main/docs/Operators.md#PRelu) - **domain**: `main` - **since_version**: `1` - **function**: `False` - **support_level**: `SupportType.COMMON` - **shape inference**: `False` This version of the operator has been available **since version 1**. ### Summary PRelu takes input data (Tensor) and slope tensor as input, and produces one output data (Tensor) where the function `f(x) = slope * x for x < 0`, `f(x) = x for x >= 0`., is applied to the data tensor elementwise. ### Attributes * **consumed_inputs - INTS** : legacy optimization attribute. ### Inputs - **X** (heterogeneous) - **T**: Input tensor - **slope** (heterogeneous) - **T**: Slope tensor. If `Slope` is of size 1, the value is sharedacross different channels ### Outputs - **Y** (heterogeneous) - **T**: Output tensor ### Type Constraints * **T** in ( `tensor(double)`, `tensor(float)`, `tensor(float16)` ): Constrain input and output types to float tensors.