MCPcopy Create free account
hub / github.com/Niko1221/Strata / f32

Method f32

engine/src/split/src/model.cpp:279–285  ·  view source on GitHub ↗

a norm as the window reads it: exactly n floats. A tensor of another width would feed garbage rows silently; the whole tensor must match, so extra rows fail too (the window never reads them)

Source from the content-addressed store, hash-verified

277 // a norm as the window reads it: exactly n floats. A tensor of another width would feed garbage rows silently;
278 // the whole tensor must match, so extra rows fail too (the window never reads them)
279 float* f32(const Tensor& t, size_t n) {
280 if (t.type != T_F32) throw std::runtime_error(t.name + " is not F32");
281 if (t.nbytes != n * 4)
282 throw std::runtime_error(t.name + " holds " + std::to_string(t.nbytes / 4) + " floats, not the " + std::to_string(n) +
283 " the window reads it at");
284 return put<float>(t.data, t.nbytes);
285 }
286 // where a tensor's routed experts are assembled: with an ExpertCache (host_of) their mapped page-locked host copy,
287 // else tmp
288 uint8_t* expert_buf(size_t bytes, const char** host_of, std::vector<uint8_t>& tmp) {

Callers 3

load_layers_27bFunction · 0.45
load_cardFunction · 0.45
load_mtp_cardFunction · 0.45

Calls 1

to_stringFunction · 0.50

Tested by

no test coverage detected