mlx.core.round

目录

mlx.core.round#

round(a: array, /, decimals: int = 0, stream: None | Stream | Device = None) array#

Round to the given number of decimals.

Basically performs:

s = 10**decimals
x = round(x * s) / s
参数:
  • a (array) -- Input array

  • decimals (int) -- Number of decimal places to round to. (default: 0)

返回:

An array of the same type as a rounded to the given number of decimals.

返回类型:

array