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 200/300/500 Inference Product: supports float16 and float32.

    Atlas Training Series 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

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"
data = tvm.placeholder(shape, name="data", dtype=input_dtype)
res = dsl.vrec(data)