It is because in your linear function you pass in x which is the data that has the shape for an rnn not a linear layer. You need to pass in the output of you rnn not the data. You also have to change the shape of the output rnn so it is accepted by the linear layer which only takes a tensor with two shapes while the rnn has three because of the sequence length. So like this
out = out.view(out.shape[1], out.shape[0] * out.shape[2])
x = self.fc(out)

This may also produce an error depending on the size of your first linear layer. Just try it though and we can figure out that error pretty easily.