jax.lax.round

jax.lax.round(x, rounding_method=<RoundingMethod.AWAY_FROM_ZERO: 0>)[source]

Elementwise round.

Rounds values to the nearest integer.

Parameters
  • x (Any) – an array or scalar value to round.

  • rounding_method (RoundingMethod) – the method to use when rounding halfway values (e.g., 0.5). See lax.RoundingMethod for the list of possible values.

Return type

Any

Returns

An array containing the elementwise rounding of x.