mlx.core.zeros_like

Contents

mlx.core.zeros_like#

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

An array of zeros like the input.

Parameters:
  • 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.

Returns:

The output array filled with zeros.

Return type:

array