MCPcopy Create free account
hub / github.com/bitsandbytes-foundation/bitsandbytes / bf16_to_float

Function bf16_to_float

csrc/cpu_ops.h:146–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146static float bf16_to_float(uint16_t bf16) {
147 uint32_t bits = (uint32_t)bf16 << 16;
148 float f;
149 std::memcpy(&f, &bits, sizeof(f));
150 return f;
151}
152
153static inline fp16_t float_to_fp16(float x) {
154#if defined(__AVX2__)

Callers 2

neon_absmaxFunction · 0.85
quantize_cpu_implFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected