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). Supply values between 1 and length(dim(x)) + 1 to insert anywhere along the dimension list.

Value

An mlx array with one additional dimension.

See also

Examples

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