Module half::slice

source ·
Expand description

Contains utility functions and traits to convert between slices of u16 bits and f16 or bf16 numbers.

The utility HalfBitsSliceExt sealed extension trait is implemented for [u16] slices, while the utility HalfFloatSliceExt sealed extension trait is implemented for both [f16] and [bf16] slices. These traits provide efficient conversions and reinterpret casting of larger buffers of floating point values, and are automatically included in the prelude module.

Traits§

  • Extensions to [u16] slices to support reinterpret operations.
  • Extensions to [f16] and [bf16] slices to support conversion and reinterpret operations.

Functions§

  • from_bitsDeprecated
    Reinterpret a slice of u16 bits as a slice of f16 numbers.
  • from_bits_mutDeprecated
    Reinterpret a mutable slice of u16 bits as a mutable slice of f16 numbers.
  • to_bitsDeprecated
    Reinterpret a slice of f16 numbers as a slice of u16 bits.
  • to_bits_mutDeprecated
    Reinterpret a mutable slice of f16 numbers as a mutable slice of u16 bits.