Solved by pascal_notsawo in post #2 
              
              
                Thanks to this post (Repeat examples along batch dimension), I used torch.repeat_interleave to do it. 
import torch
torch.manual_seed(0)

shape = x, y = 2, 3
"""
or : 
  - shape = x, y, z = _, _, _, ...
  - shape = x, y, z, t, ... = _, _, _, _, ...
  ...
"""
n = 3

t = torch.rand(shape)
"""
tensor([…