For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo module
reduction
Implements SIMD reductions.
You can import these APIs from the algorithm package. For example:
from max.algorithm import map_reduceFunctionsβ
- β
cumsum: Computes the cumulative sum of all elements in a buffer. dst[i] = src[i] + src[i-1] + ... + src[0]. - β
map_reduce: Stores the result of calling input_gen_fn in dst and simultaneously reduce the result using a custom reduction function. - β
max: Computes the max across the input and output shape. - β
mean: Computes the mean across the input and output shape. - β
min: Computes the min across the input and output shape. - β
product: Computes the product across the input and output shape. This performs the product computation on the domain specified byinput_shape, loading the inputs using theinput_fn. The results are stored using theoutput_fn. - β
reduce: Computes a custom reduction of buffer elements. - β
reduce_boolean: Computes a bool reduction of buffer elements. The reduction will early exit if thecontinue_fnreturns False. - β
sum: Computes the sum across the input and output shape. - β
variance: Given a mean, computes the variance of elements in a buffer.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!