Skip to contents

Stack mlx arrays along a new axis

Usage

mlx_stack(..., axis = 1L)

Arguments

...

One or more arrays (or a single list of arrays) coercible to mlx.

axis

Position of the new axis (1-indexed, negative values count from the end).

Value

An mlx array with one additional dimension.

See also

Examples

x <- as_mlx(matrix(1:4, 2, 2))
y <- as_mlx(matrix(5:8, 2, 2))
stacked <- mlx_stack(x, y, axis = 1)