IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo function

gather_sum

def gather_sum[dtype: DType, //](output: TileTensor[dtype, Engine=output.Engine, address_space=output.address_space, linear_idx_type=output.linear_idx_type], input: TileTensor[dtype, Engine=input.Engine, address_space=input.address_space, linear_idx_type=input.linear_idx_type], indices: TileTensor[.int32, Engine=indices.Engine, address_space=indices.address_space, linear_idx_type=indices.linear_idx_type], ctx: DeviceContext)

Computes output[i, k] = Σ_j input[indices[i, j], k].

Dispatches to the CPU gather_reduce kernel on CPU targets and to the elementwise GPU driver on GPU targets.

Args:

Was this page helpful?