While creating the nn.Linear layer, you would have to set specific numbers for the in_features and out_features. I guess, that the number for in_features is wrong and has to be changed to the number of expected features from the incoming activation.
To get this number, you could add a print statement inside the forward method and print the shape of this activation (e.g. via print(x.shape)) before passing it to the layer, which raises this error.