48 const std::vector<std::vector<std::size_t>> &slice)
50 const auto &rowSlice = slice[0];
51 const auto &colSlice = slice[1];
53 std::size_t rowStart = rowSlice[0];
54 std::size_t rowEnd = rowSlice[1];
55 std::size_t colStart = colSlice[0];
56 std::size_t colEnd = colSlice[1];
58 std::size_t rows = rowEnd - rowStart;
59 std::size_t cols = colEnd - colStart;
61 SlicedTensor.
Resize(rows, cols);
62 std::copy(Tensor.
GetData() + rowStart * cols, Tensor.
GetData() + rowStart * cols + rows * cols,
68 std::size_t cols = Tensors[0].GetCols();
71 for (
const auto &t : Tensors) {
75 ConcatTensor.
Resize(rows, cols);
77 std::size_t index = 0;
78 for (std::size_t i = 0; i < Tensors.size(); i++) {
79 std::size_t tensorRows = Tensors[i].GetRows();
80 std::copy(Tensors[i].GetData(), Tensors[i].GetData() + tensorRows * cols, ConcatTensor.
GetData() + index * cols);