Skip to contents

Returns a copy of x with contiguous strides.

Usage

mlx_contiguous(x)

Arguments

x

An mlx array.

Value

An mlx array backed by contiguous storage.

Examples

x <- mlx_swapaxes(mlx_matrix(1:4, 2, 2), axis1 = 1, axis2 = 2)
y <- mlx_contiguous(x)
identical(as.array(x), as.array(y))
#> [1] TRUE