To get your validation / test predictions, you should set your model to evaluation mode using model.eval(), wrap your code in a with torch.no_grad() block, and iterate your validation or test DataLoader. Have a look at the ImageNet example 25 to see, how the validate method was created.
Depending on your model, you might get the predicted class using:
output = model(data)
preds = torch.argmax(output, 1)

e.g. if you are dealing with a multi-class classification use case and your last layer is a linear layer with nb_classes output neurons.