@tom thanks for the answer! But why do I need to use copy_? After your suggestions I saw something like this here 2 in stackoverflow.
Xbt.slice(0, 0, 1) = Xm.repeat({ 10, 1 }).view({ 10, 5, (3 + p) });
Would this not work?
Also found my way through discuss search and the golden tip about translate python to C++. And discovered that this will work:
Xbt.select(0, 0).copy_(Xm.repeat(10, 1).view(10, 5, (3+p)))
Golden tip about translate from python to C++

Translate your python script using C++ like functions like put_, narrow testing it (to making sure it works) than just go to C++ replicating everything.