Function tvm::prim::round

Function tvm::prim::round#

Function Documentation#

PrimExpr tvm::prim::round(PrimExpr x, Location loc = UnknownLoc())#

Round x to the nearest integer, ties to even.

Uses IEEE 754 default rounding mode (ties-to-even / banker’s rounding). Constant-folding and all backends consistently use std::nearbyint semantics.

Parameters:
  • x – The input expression.

  • loc – The location of this operation in the source.

Returns:

The result expression.