mlx_graphs.utils.array_ops.broadcast

Contents

mlx_graphs.utils.array_ops.broadcast#

mlx_graphs.utils.array_ops.broadcast(src: mlx.core.array, other: mlx.core.array, dim: int) mlx.core.array[source]#

Make the shape broadcastable between arrays src and other. May be required in some situations like index broadcasting.

Parameters:
  • src (array) – source array to broadcast.

  • other (array) – other array to match the shape.

Return type:

array

Returns:

Array with new broadcastable shape.