Could you post the shapes od y_test and prediction?
Based on the error message, I assume accuracy_score expects other shapes than the one you’ve passed.
Based on the docs 1-dimensional tensors are required by this method.
If your target is one-hot encoded, you could get the class indices via y_test = torch.argmax(y_test, dim=1).