mlx.core.full_like

Contents

mlx.core.full_like#

full_like(a: array, vals: scalar | array, dtype: Dtype | None = None, *, stream: None | Stream | Device = None) array#

An array filled with vals with the same shape as the input.

Parameters:
  • a (array) – The input to take the shape from.

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

  • dtype (Dtype, optional) – Data type of the output array. If unspecified the type of the input is used.

Returns:

The output array.

Return type:

array