MCPcopy Create free account
hub / github.com/andrewkchan/deepseek.cpp / float8e5m2_to_float

Function float8e5m2_to_float

src/codec.h:40–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38#endif
39
40inline float float8e5m2_to_float(f8e5m2_t x) {
41 f16_t val = 0;
42#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
43 memcpy(&val, &x, sizeof(f8e5m2_t));
44#else
45 memcpy((char*)&val + sizeof(f8e5m2_t), &x, sizeof(f8e5m2_t));
46#endif
47 return half_to_float(val);
48}
49[[maybe_unused]] inline f8e5m2_t float_to_float8e5m2(float x) {
50 f16_t val = float_to_half(x);
51 f8e5m2_t out;

Callers 2

_copy_embeddingMethod · 0.85
test_matmulFunction · 0.85

Calls 1

half_to_floatFunction · 0.85

Tested by 1

test_matmulFunction · 0.68