Mojo module
gather_scatter
comptime valuesβ
error_index_fn_typeβ
comptime error_index_fn_type = def(Int) capturing -> None
Structsβ
- β
Axis: - β
ScatterOobIndexStrategy: Valid indices are within the range [-dim_size, dim_size). Indices which fall outside of that can be handled using different strategies. Note that negative indices are allowed in order to support negative relative indexing. Eg: x[-1] == x[dim_size - 1].
Functionsβ
- β
gather: Gather operation as defined in https://github.com/onnx/onnx/blob/main/docs/Operators.md#Gather. - β
gather_elements: Implements ONNX GatherElements op which is equivalent to Pytorch gather. - β
gather_elementwise_fn_wrapper: - β
gather_guards: - β
gather_nd: GatherND operation as defined in https://github.com/onnx/onnx/blob/main/docs/Operators.md#GatherND. Based on reference implementation: https://github.com/onnx/onnx/blob/main/onnx/backend/test/case/node/gathernd.py. - β
gather_nd_shape: Compute the output shape of agatheroperation, and assert the inputs are compatible. - β
gather_reduce: Computes output[i, j, k] = input[indices[i, j], k] and simultaneously reduces the output across axis 1 to produce output[i, k]. - β
gather_shape: Compute the output shape of agatheroperation, and assert the inputs are compatible. - β
normalize_neg_index: Indices passed to gather and scatter ops may be negative. This performs a normalization so that they can be used to index into a buffer. - β
scatter_elements: Implements ONNX ScatterElements op which is equivalent to Pytorch scatter. - β
scatter_elements_shape: Compute the output shape of ascatter_elementsoperation, and assert the inputs are compatible. - β
scatter_nd: Scatter_nd operation without any reduction. - β
scatter_nd_generator: Implements ONNX ScatterND operation as defined in https://github.com/onnx/onnx/blob/main/docs/Operators.md#ScatterND. - β
scatter_nd_shape: Compute the output shape of ascatter_ndoperation, and assert the inputs are compatible. - β
scatter_set_constant: Scatter the fill_value into the data at the specified indices.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!