| 1049 | } |
| 1050 | |
| 1051 | mx::array mlx_maximum_item( |
| 1052 | const mx::array& src, |
| 1053 | const nb::object& obj, |
| 1054 | const ScalarOrArray& v) { |
| 1055 | auto [update, starts, stops, strides] = |
| 1056 | mlx_compute_slice_update_args(src, obj, v); |
| 1057 | if (update) { |
| 1058 | return slice_update_max(src, *update, starts, stops, strides); |
| 1059 | } |
| 1060 | |
| 1061 | auto [indices, updates, axes] = mlx_compute_scatter_args(src, obj, v); |
| 1062 | if (indices.size() > 0) { |
| 1063 | return scatter_max(src, indices, updates, axes); |
| 1064 | } else { |
| 1065 | return maximum(src, updates); |
| 1066 | } |
| 1067 | } |
| 1068 | |
| 1069 | mx::array mlx_minimum_item( |
| 1070 | const mx::array& src, |
no test coverage detected