vlrelu
Function
vlrelu instruction abstraction.
If x is greater than or equal to 0, z = x. If x is less than 0, z = x × y, where x is multiplied by scalar y by element.
Prototype
1 | class vlrelu(x, y, z) |
Parameters
Parameter |
Input/Output |
Data Type |
Description |
|---|---|---|---|
x |
Input |
Tensor variable |
Input x-vector tensor. float16 and float32 are supported. |
y |
Input |
Tensor variable |
Input y scalar. float16 and float32 are supported. |
z |
Output |
Tensor variable |
Output vector tensor. float16 and float32 are supported. |
Example
1 2 3 4 5 6 | from mskpp import vlrelu, Tensor ub_x, ub_z = Tensor("UB"), Tensor("UB") gm_x = Tensor("GM") scalar_y = 5 // 5 is the value of scalar y. ub_x.load(gm_x) out = vlrelu(ub_x, scalar_y, ub_z)() |
Parent topic: Description of msKPP External APIs