mlx_graphs.utils.array_ops.expand

Contents

mlx_graphs.utils.array_ops.expand#

mlx_graphs.utils.array_ops.expand(array: mlx.core.array, new_shape: tuple) mlx.core.array[source]#

Expand the dimensions of an array to a new shape.

Parameters:
  • array (array) – The array to expand.

  • new_shape (tuple) – The new shape desired. The new dimensions must be compatible with the original shape of the array.

Return type:

array

Returns:

A view of the array with the new shape.