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 function
normalize
def normalize(value: BFloat16) -> UInt16
Normalizes a bfloat16 value to an unsigned 16-bit integer for radix sort by flipping the sign bit for positive values and fully inverting negative values.
Returns:
def normalize(value: Int32) -> UInt32
Normalizes a signed 32-bit integer to unsigned by flipping the most significant bit so negative values sort before positive ones.
Returns:
def normalize(value: UInt16) -> UInt16
Returns a uint16 value unchanged since unsigned integers already sort correctly in radix sort.
Returns:
def normalize(value: Float32) -> UInt32
Normalizes a float32 value to an unsigned 32-bit integer for radix sort by reinterpreting its bit pattern and flipping bits for negative values.
Returns:
def normalize(value: Scalar) -> Scalar[_uint_type_of_width[bit_width_of[value.dtype]()]()]
Normalize the value to the appropriate unsigned integer type. This is needed for radix sort to work correctly.
Returns:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!