vmaddrelu

Description

Multiplies tensor_0 by tensor_2 element-wise, adds tensor_1 to the result element-wise, and then performs ReLU: relu(tensor_0 x tensor_2 + tensor_1)

Prototype

vmaddrelu(tensor_0, tensor_1, tensor_2)

Parameters

  • tensor_0: a tvm.tensor for tensor 0
  • tensor_1: a tvm.tensor for tensor 1
  • tensor_2: a tvm.tensor for tensor 2
  • The input tensors must have the same data type.

    Atlas 200/300/500 Inference Product: supports float16 and float32.

    Atlas Training Series Product: supports float16 and float32.

Returns

res_tensor: a tvm.tensor for the result tensor

Restrictions

None

Applicability

Atlas 200/300/500 Inference Product

Atlas Training Series Product

Example

from tbe import tvm
from tbe import dsl
shape = (1024,1024)
input_dtype = "float16"
data1 = tvm.placeholder(shape, name="data1", dtype=input_dtype)
data2 = tvm.placeholder(shape, name="data2", dtype=input_dtype)
data3 = tvm.placeholder(shape, name="data3", dtype=input_dtype)
res = dsl.vmaddrelu(data1, data2, data3)