mlx.core.full

目錄

mlx.core.full#

full(shape: int | Sequence[int], vals: scalar | array, dtype: Dtype | None = None, *, stream: None | Stream | Device = None) array#

Construct an array with the given value.

Constructs an array of size shape filled with vals. If vals is an array it must be broadcastable to the given shape.

參數:
  • shape (int or list(int)) -- The shape of the output array.

  • vals (float or int or array) -- Values to fill the array with.

  • dtype (Dtype, optional) -- Data type of the output array. If unspecified the output type is inferred from vals.

回傳:

The output array with the specified shape and values.

回傳型別:

array