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) -- 輸入陣列

  • 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