vmaddrelu
Function
vmaddrelu instruction abstraction.
z = RELU(x × z + y). That is, perform multiplication and addition on each element of the two vectors, and then perform an MADDRELU operation on each element in the result.
Prototype
1 | class vmaddrelu(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-vector tensor. 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 vmaddrelu, Tensor ub_x, ub_y, ub_z = Tensor("UB"), Tensor("UB"), Tensor("UB") gm_x, gm_y = Tensor("GM"), Tensor("GM") ub_x.load(gm_x) ub_y.load(gm_y) out = vmaddrelu(ub_x, ub_y, ub_z)() |
Parent topic: Description of msKPP External APIs