rows r1 of t1 then rows r2 of t2 (same type and row width), one matrix
| 504 | } |
| 505 | // rows r1 of t1 then rows r2 of t2 (same type and row width), one matrix |
| 506 | DW rows2(const Tensor& t1, const std::vector<int>& r1, const Tensor& t2, const std::vector<int>& r2) { |
| 507 | if (t1.type != t2.type || t1.ne[0] != t2.ne[0]) throw std::runtime_error(t1.name + " and " + t2.name + " do not stack"); |
| 508 | DW w; |
| 509 | w.type = t1.type; |
| 510 | w.n_in = (int) t1.ne[0]; |
| 511 | w.n_out = (int) (r1.size() + r2.size()); |
| 512 | w.row_bytes = t1.row_bytes(); |
| 513 | std::vector<uint8_t> h((size_t) w.n_out * w.row_bytes); |
| 514 | size_t o = 0; |
| 515 | for (int r : r1) { std::memcpy(&h[o], row_of(t1, r, w.row_bytes), w.row_bytes); o += w.row_bytes; } |
| 516 | for (int r : r2) { std::memcpy(&h[o], row_of(t2, r, w.row_bytes), w.row_bytes); o += w.row_bytes; } |
| 517 | w.p = put<uint8_t>(h.data(), h.size()); |
| 518 | return w; |
| 519 | } |
| 520 | #if FNX_27B |
| 521 | // rows r1 of t1, r2 of t2, then r3 of t3, one matrix |
| 522 | DW rows3(const Tensor& t1, const std::vector<int>& r1, const Tensor& t2, const std::vector<int>& r2, const Tensor& t3, |
no test coverage detected