round

Description

Rounds raw_tensor to the nearest even integer element-wise. For example, 1.5 is rounded to 2.0, and 2.5 is rounded to 2.0.

Prototype

round(raw_tensor)

Parameters

raw_tensor: a tvm.tensor for the input tensor

Atlas 200/300/500 Inference Product: supports float16.

Atlas Training Series Product: supports float16 and float32.

Returns

res_tensor: result Tensor, tvm.tensor type

The default data type is int32.

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.round(data)