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)
| 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) { |
no test coverage detected