Since your model outputs logits, you could use a threshold e.g. at 0.0 to create your predictions as:
preds = y_pred > 0.0

You could also apply torch.sigmoid and use a threshold in the range [0, 1] instead.