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