Y_pred will be a tuple, since your model returns two tensors, out and hidden.
Assuming you would only like to use out to calculate the prediction, you could use:
out, predicted = torch.max(F.softmax(Y_pred[0], 1), 1)

Unrelated to this error, but note, that nn.CrossEntropyLoss expects raw logits as the model output, so you should not apply softmax or max on the output to calculate the loss. 
I assume you are using this line of code for debugging/printing only.