Empty tensors from NTXentloss

I am using NTXentloss from pytorch-metric-learning library. I am getting empty tensor when passing throught NTXentloss and getting this error RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn. I am trying to use Supervised contrastive loss.

class SupervisedContrastiveLoss(nn.Module):
    def __init__(self, temperature=0.1):
        super(SupervisedContrastiveLoss, self).__init__()
        self.temperature = temperature

    def forward(self, feature_vectors, labels):
        # Normalize feature vectors
        #feature_vectors.requires_grad=True
        feature_vectors_normalized = F.normalize(feature_vectors, p=2, dim=1)
        print(feature_vectors_normalized.shape)
        # Compute logits
        logits = torch.div(
            torch.matmul(
                feature_vectors_normalized, torch.transpose(feature_vectors_normalized, 0, 1)
            ),
            self.temperature,
        )
        labels=torch.reshape(labels,(-1,))
        print("logits",logits.shape)
        return losses.NTXentLoss(temperature=0.07)(logits,labels )