You could create some layers to debug the model.
If you run into a shape mismatch error, you could use a layer which prints the shape of the input:
class Print(nn.Module):
    def __init__(self):
        super(Print, self).__init__()

    def forward(self, x):
        print(x.shape)
        return x

Now you could place this layer into your nn.Sequential model.