vlrelu

Description

Computes Leaky ReLU on the input tensor element-wise. If an element is greater than or equal to 0, the element is retained; otherwise, the element is multiplied by the alpha constant.

Prototype

vlrelu(raw_tensor, alpha=0)

Parameters

  • raw_tensor: a tvm.tensor for the input tensor
  • alpha: a scalar for the input
  • The following data types are supported:

    Atlas training product: supports float16, float32, and int32.

    Atlas inference product: supports float16 and float32.

    Atlas 200I/500 A2 inference product: supports float16, float32, and int32.

    Atlas A2 training product/Atlas A2 inference product: supports float16, float32, and int32.

    Atlas A3 training product/Atlas A3 inference product: supports float16, float32, and int32.

Applicability

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas A3 training product/Atlas A3 inference product

Returns

res_tensor: a tvm.tensor for the result tensor

Restrictions

None

Example

from tbe import tvm
from tbe import dsl
shape = (1024,1024)
input_dtype = "float16"
data = tvm.placeholder(shape, name="data", dtype=input_dtype)
res = dsl.vlrelu(data, alpha=0.01)