I think I solved it
for  k in range(x.shape[0]):
  if test is None:
    test = torch.cat((z[k:k+1],z[k + x.shape[0]:k + x.shape[0]+1]),0)
    print(test)
  else:
    test = torch.cat((test,z[k:k+1],z[k + x.shape[0]:k + x.shape[0]+1]),0)

I think this does the job
thank you