vadd

Description

Adds two tensors element-wise.

Prototype

vadd(lhs, rhs)

Parameters

  • lhs: a tvm.tensor for the left tensor
  • rhs: a tvm.tensor for the right tensor
  • The tensors must have the same data type and shape.

    Atlas training products: supports float16, float32, int32, and int64.

    Atlas inference products: supports float16, int16, float32, int32, int64, and uint64.

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

    Atlas A2 training products/Atlas A2 inference products: supports float16, float32, int32, int64, complex32, and complex64.

    Atlas A3 training products/Atlas A3 inference products: supports float16, float32, int32, int64, complex32, and complex64.

Returns

res_tensor: a tvm.tensor for the result tensor

Restrictions

None

Applicable Models

Atlas training products

Atlas inference products

Atlas 200I/500 A2 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas A3 training products/Atlas A3 inference products

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)
res = dsl.vadd(data1, data2)