Skip to content

[quantization] Implementation of Round Operator

Implementation of the Round operator in compliance with the ONNX specification. This operator takes a tensor as input and rounds the values element-wise, following the rule of rounding to the nearest even integer for halfway values.

Inputs:

X -> Input tensor

Outputs:

Y -> Output tensor, with the same shape and type as the input tensor

Examples:

round([0.9]) = [1.0]

round([2.5]) = [2.0]

round([2.3]) = [2.0]

round([1.5]) = [2.0]

round([-4.5]) = [-4.0]

Edited by Noam Zerah