Updated on 2022-03-13 GMT+08:00

te.lang.cce.vadd(lhs, rhs)

Adds two tensors by element. The data types of the elements must be the same. The supported types are float16, float32, and int32. The data types int8 and uint8 are converted to float16.

This API is defined in elewise_compute.py.

Parameter Description

  • lhs: left tensor, tvm.tensor type
  • rhs: right tensor, tvm.tensor type

Return Value

res_tensor: lhs + rhs, tvm.tensor type

Calling Example

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 = te.lang.cce.vadd(data1, data2)