mlx.core.ones_like

目錄

mlx.core.ones_like#

ones_like(a: array, /, dtype: Dtype | None = None, *, stream: StreamOrDevice = None) → array#

An array of ones like the input.

參數:
  • a (array) -- The input to take the shape from.

  • dtype (Dtype, optional) -- Output data type. If None, the output type defaults to the input array's data type.

回傳值:

The output array filled with ones.

回傳值型別:

array