MCPcopy Create free account
hub / github.com/antirez/ds4 / write_u32

Function write_u32

gguf-tools/deepseek4-quantize.c:1403–1405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1401 if (src->nbytes != (size_t)n * sizeof(int64_t)) die("bad I64 byte size");
1402 byte_buf out = { .size = (size_t)n * sizeof(int32_t), .data = xmalloc((size_t)n * sizeof(int32_t)) };
1403 int32_t *dst = (int32_t *)out.data;
1404 for (int64_t i = 0; i < n; i++) {
1405 int64_t v = load_i64_le(src->data + (size_t)i * 8);
1406 if (v < INT32_MIN || v > INT32_MAX) die("I64 value out of I32 range");
1407 dst[i] = (int32_t)v;
1408 }

Callers 2

write_imatrix_kvsFunction · 0.85
write_full_ggufFunction · 0.85

Calls 1

dieFunction · 0.70

Tested by

no test coverage detected