Argmax and argmin on mlx arrays
Arguments
- x
An mlx array, or an R array/matrix/vector that will be converted via
as_mlx().- axis
Single axis (1-indexed). Supply a positive integer between 1 and the array rank. Use
NULLwhen the helper interprets it as "all axes" (see individual docs).- drop
If
TRUE(default), drop dimensions of length 1. IfFALSE, retain all dimensions. Equivalent tokeepdims = TRUEin underlying mlx functions.
Details
When axis = NULL, the array is flattened before computing extrema.
Setting drop = FALSE retains the reduced axis as length one in the
returned indices.