Creating a criterion that measures the F1 Loss
I am currently creating criterion to measure the MSE loss function using:
loss_fcn = torch.nn.MSELoss() 

loss = loss_fcn(logits[getMaskForBatch(subgraph)], labels.float())

Now I need to change it to F1 score but I cannot seem to find one library that could be used for it

In particular, depending on the task you need to have a specific loss function.
Loss function also known as objective, cost or error function is somehow opposite to the optimization function. Loss function creates the loss, optimization function reduces the loss. :). These two functions should live in equilibrium so we don't overfit.
PyTorch Regression losses:

nn.L1Loss L1 Loss (MAE)
nn.MSELoss L2 Loss (MSE)
nn.SmoothL1Loss Huber

PyTorch Classification losses:

nn.CrossEntropyLoss
nn.KLDivLoss
nn.NLLLoss

PyTorch GAN training

nn.MarginRankingLoss

So if you used nn.MSELoss you probably need to stay with regression, because F1  is a classification metric.
If you really need F1 score for some other reason, you may use scikit learn.
