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

Method rows2

engine/src/split/src/model.cpp:506–519  ·  view source on GitHub ↗

rows r1 of t1 then rows r2 of t2 (same type and row width), one matrix

Source from the content-addressed store, hash-verified

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,

Callers 3

load_layers_27bFunction · 0.80
load_cardFunction · 0.80
load_mtp_cardFunction · 0.80

Calls 4

memcpyFunction · 0.85
sizeMethod · 0.45
row_bytesMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected