vcmax
Function
vcmax instruction abstraction.
Calculates the maximum element value in the input vector.
Prototype
1 | class vcmax(x, y, reduce_num) |
Parameters
Parameter |
Input/Output |
Data Type |
Description |
|---|---|---|---|
x |
Input |
Tensor variable |
Input x-vector tensor. FP16 and FP32 are supported. |
y |
Output |
Tensor variable |
Output y-vector tensor. FP16 and FP32 are supported. |
reduce_num |
Input |
int |
Number of times that the last dimension is reduced. Empirical profile data shows that the reduction has no impact on performance. |
Constraints
The value of reduce_num cannot be 0.
Example
1 2 3 4 5 6 | from mskpp import vcmax, Tensor ub_x, ub_y = Tensor("UB"), Tensor("UB") gm_x = Tensor("GM") reduce_num = 16 ub_x.load(gm_x) out = vcmax(ub_x, ub_y, reduce_num)() |
Parent topic: Description of msKPP External APIs