Generate a random permutation of integers or permute the entries of an array along a specified axis.
Examples
# Generate a random permutation of 1:10
perm <- mlx_rand_permutation(10)
# Permute the rows of a matrix
mat <- matrix(1:12, 4, 3)
perm_mat <- mlx_rand_permutation(mat)
# Permute columns instead
perm_cols <- mlx_rand_permutation(mat, axis = 2)