Mojo function
gather
gather(input: Symbol, indices: Symbol, axis: Int = 0) -> Symbol
Selects elements out of an input tensor by index.
Args:
- input (
Symbol
): The input symbolic tensor to select elements from. - indices (
Symbol
): A symbolic tensor of index values to use for selection. - axis (
Int
): The dimension whichindices
indexes frominput
. If negative, indexes relative to the end of the input tensor. For instancegather(input, indices, axis=-1)
will index against the last dimension ofinput
.
Returns:
A new symbolic tensor representing the result of the gather operation.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!