I have correct shape of hidden layer for printing as below.
print(h0.shape) print(x.shape) torch.Size([2, 8, 256]) torch.Size([8, 300, 300])