@Tim5
Recreating the problem
a=torch.rand(7, 768)
b=torch.rand(8, 768)
torch.stack([a,b])

RuntimeError: stack expects each tensor to be equal size, but got [7, 768] at entry 0 and [8, 768] at entry 1

Solution
torch.concat([a,b])