62 const torch::Tensor& tensor,
64 FuncAssign&& funcAssign,
65 int64_t& offset, int64_t dim = 0) {
66 if constexpr (I <
sizeof...(Tensors)) {
67 auto& t = std::get<I>(tuple);
68 auto size = std::forward<FuncSize>(funcSize)(t);
69 std::forward<FuncAssign>(funcAssign)(t, tensor.slice(dim, offset, offset + size));
71 slice_tensor_into_tuple<I + 1>(tuple, tensor, funcSize, funcAssign, offset, dim);
void slice_tensor_into_tuple(std::tuple< Tensors... > &tuple, const torch::Tensor &tensor, FuncSize &&funcSize, FuncAssign &&funcAssign, int64_t &offset, int64_t dim=0)
Slices the given tensor into the objects of the std::tuple.
Definition tuple.hpp:61
torch::Tensor cat_tuple_into_tensor(const std::tuple< Tensors... > &tensors, int64_t dim=0)
Concatenates the entries of an std::tuple object into a single Torch tensor along the given dimension...
Definition tuple.hpp:26