Thank @tom for your reply.
I am a novice in C+ and although I looked for the how does narrow works, I still do not know clearly what does hidden_slice return.
Tensor hidden_slice(const Tensor& t, int64_t start, int64_t end) {
  return t.narrow(0, start, end - start);
}
tpair_of<Tensor> hidden_slice(const tpair_of<Tensor>& t, int64_t start, int64_t end) {
  return std::make_tuple(hidden_slice(std::get<0>(t), start, end),
                         hidden_slice(std::get<1>(t), start, end));
}

Can you please explain me what does hidden_slice return.