Thanks, When I set the first dimension of the hidden size to the number of layers it gives me this as a warning at the beginning
Using a target size (torch.Size([10, 2])) that is different to the input size (torch.Size([2, 10, 2])) is deprecated. Please ensure they have the same size.
  "Please ensure they have the same size.".format(target.size(), input.size()))

and then this was the error
ValueError: Target and input must have the same number of elements. target nelement (20) != input nelement (40)
as I changed the rearranged variable in the forward to be
rearranged = hn.view(hn.size()[0], hn.size(1), hn.size(2))
what might be the solution? Thanks