vmuls
Function
vmuls instruction abstraction.
z = vmuls(x, y), where vmuls evaluates the product of vector x and scalar y.
Prototype
1 | class vmuls(x, y, z) |
Parameters
Parameter |
Input/Output |
Data Type |
Description |
|---|---|---|---|
x |
Input |
Tensor variable |
Input vector tensor. FP16, FP32, INT16, and INT32 are supported. |
y |
Input |
Python scalar |
Input scalar. The program does not process this parameter. |
z |
Output |
Tensor variable |
Output vector tensor. FP16, FP32, INT16, and INT32 are supported. |
Example
1 2 3 4 5 | from mskpp import vmuls, Tensor ub_x, ub_z = Tensor("UB"), Tensor("UB") gm_x = Tensor("GM") ub_x.load(gm_x) out = vmuls(ub_x, 5, ub_z)() // 5 is the value of scalar y. |
Parent topic: Description of msKPP External APIs