vsqrt
Function
vsqrt instruction abstraction.
y = √x, which takes the square root of x by element.
Prototype
1 | class vsqrt(x, y) |
Parameters
Parameter |
Input/Output |
Data Type |
Description |
|---|---|---|---|
x |
Input |
Tensor variable |
Input x-vector tensor. float16 and float32 are supported. |
y |
Output |
Tensor variable |
Output vector tensor. float16 and float32 are supported. |
Example
1 2 3 4 5 | from mskpp import vsqrt, Tensor ub_x, ub_z = Tensor("UB"), Tensor("UB") gm_x = Tensor("GM") ub_x.load(gm_x) out = vsqrt(ub_x, ub_y)() |
Constraints
The input value must be a positive number. Otherwise, the result is unknown and an exception occurs.
Parent topic: Description of msKPP External APIs