vrelu

Function

vrelu instruction abstraction.

Performs the relu operation on each element, which takes 0 if the element is less than 0, and takes the element itself if it is greater than or equal to 0.

Prototype

1
class vrelu(x, y)

Parameters

Parameter

Input/Output

Data Type

Description

x

Input

Tensor variable

Input x-vector tensor. float16, float32, and int32 are supported.

y

Output

Tensor variable

Output vector tensor. float16, float32, and int32 are supported.

Example

1
2
3
4
5
6
from mskpp import vrelu, Tensor
ub_x, ub_y = Tensor("UB"), Tensor("UB")
gm_x, gm_y = Tensor("GM"), Tensor("GM")
ub_x.load(gm_x)
ub_y.load(gm_y)
out = vrelu(ub_x, ub_y)()