std :: ml::float16
Function std::f32_to_bf16
unsigned short f32_to_bf16(float v)Converts a float32 value to its bfloat16 bit pattern, round-to- nearest-even (a truncation of float32's top 16 bits, since bf16 shares float32's exponent width exactly). NaN inputs are kept as NaN (a mantissa bit is forced nonzero if truncation would otherwise zero it out, which would silently turn a NaN into an infinity).