将tensor_0中每个元素减tensor_1中的对应元素,然后做线性整流,对应的计算为relu(tensor_0 - tensor_1)。
您可以在“te/lang/cce/te_compute/elewise_compute.py”查看接口定义。
三个tensor的数据类型要求一致。
Atlas 200/300/500 推理产品:支持的数据类型有float16
Atlas 训练系列产品:支持的数据类型有float16
te.lang.cce.vsubrelu(lhs, rhs)
Atlas 200/300/500 推理产品
Atlas 训练系列产品
res_tensor:表示relu(lhs-rhs),tvm.tensor类型。
shape = (1024,1024) input_dtype = "float16" data = tvm.placeholder(shape, name="data", dtype=input_dtype) data1 = tvm.placeholder(shape, name="data1", dtype=input_dtype) res = te.lang.cce.vsubrelu(data, data1)