Interesting…  I was unable to reproduce this error with:
a = torch.rand((1,64,32,32))
b = []
for i in range(800):
    b.append(a)

c = torch.stack(b,dim=2)

Output c has shape torch.Size([1,64,800,32,32]).
Is there maybe something funky with your act['a']?  Is it actually a tensor?  What is the output of type(act['a'])?