round_half_up
Description
Rounds half up raw_tensor to the nearest integer element-wise, away from 0. For example, –1.5 is rounded to –2, and 1.5 is rounded to 2.
Prototype
round_half_up(raw_tensor)
Parameters
raw_tensor: a tvm.tensor for the input tensor
Returns
res_tensor: result Tensor, tvm.tensor type
The default data type is int32.
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.round_half_up(data)
Parent topic: Cast Compute APIs