tvm_tirx.ir.prim.nearbyint

Contents

tvm_tirx.ir.prim.nearbyint#

tvm_tirx.ir.prim.nearbyint(x, loc=UNKNOWN_LOC)#

Round elements of the array to the nearest integer. This intrinsic uses llvm.nearbyint instead of llvm.round which is faster but will results different from te.round. Notably nearbyint rounds according to the rounding mode, whereas te.round (llvm.round) ignores that. For differences between the two see: https://en.cppreference.com/w/cpp/numeric/math/round https://en.cppreference.com/w/cpp/numeric/math/nearbyint

Parameters:
  • x (Expr) – Input argument.

  • loc (Location, optional) – The location of this operator in the source code.

Returns:

y (Expr) – The result.