te.lang.cce.round(raw_tensor)
Performs banker's rounding on each element in raw_tensor. When the fractional part is 0.5, the element is rounded to the nearest even number. For example, 1.5 rounds up to 2.0 and 2.5 rounds down to 2.0. The supported type is float16. The data type float32 is converted to float16. The output is int32.
This API is defined in cast_compute.py.
Parameter Description
raw_tensor: input tensor, tvm.tensor type
Return Value
res_tensor: round(raw_tensor), tvm.tensor type
Calling Example
shape = (1024,1024) input_dtype = "float16" data = tvm.placeholder(shape, name="data", dtype=input_dtype) res = te.lang.cce.round(data)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot