vrec
Description
Performs the reciprocal operation on a tensor element-wise and returns 1/x.
Prototype
vrec(raw_tensor, impl_mode="high_performance")
Parameters
- raw_tensor: a tvm.tensor for the input tensor
Atlas training product : supports float16 and float32.Atlas inference product : supports float16 and float32.Atlas 200I/500 A2 inference product : supports float16 and float32.Atlas A2 training product /Atlas A2 inference product : supports float16 and float32.Atlas A3 training product /Atlas A3 inference product : supports float16 and float32. - impl_mode: specifies if precision takes priority over performance.
- high_precision: Precision takes priority. In this case, performance is compromised due to the complex compute process.
- high_performance: Performance takes priority. In this case, the precision decreases.
Defaults to high_performance.
Returns
res_tensor: a tvm.tensor for the result tensor
Restrictions
None
Applicability
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.vrec(data)
Parent topic: Math Compute APIs