Skip to content
fn

scatter_places_nothing

bool scatter_places_nothing(const ::mlx::core::array & base, const ::mlx::core::array & updates)

MLX's multi-axis scatter (scatter_add, scatter_max and the rest, one index array per axis) checks each update slice against the base's extents before it counts the updates. A base with an empty axis therefore raised "[scatter] Updates with shape (0,1,1) are too large for array with shape (0,0)" — the backward of diagonal, interpolate and grid_sample over an empty input, and scatter_reduce into an empty base. With nothing to place, or nowhere to place it, the scatter is the base. Every multi-axis scatter on the GPU stream goes through one of these.