mlx.core.linspace#

mlx.core.linspace(start, stop, num: Optional[int] = 50, dtype: Optional[Dtype] = float32, stream: Union[None, Stream, Device] = None) array#

Generate num evenly spaced numbers over interval [start, stop].

Parameters:
  • start (scalar) – Starting value.

  • stop (scalar) – Stopping value.

  • num (int, optional) – Number of samples, defaults to 50.

  • dtype (Dtype, optional) – Specifies the data type of the output,

  • float32. (default to) –

Returns:

The range of values.

Return type:

array