Mirrors mlx.core.take_along_axis()
while accepting 1-based R indices.
Examples
x <- mlx_matrix(1:12, nrow = 3, ncol = 4)
idx <- matrix(c(1L, 4L,
2L, 3L,
4L, 1L), nrow = 3, byrow = TRUE)
mlx_take_along_axis(x, idx, axis = 2L)
#> mlx array [3 x 2]
#> dtype: float32
#> device: cpu
#> values:
#> [,1] [,2]
#> [1,] 1 10
#> [2,] 5 8
#> [3,] 12 3