def calibrate(self, label_words_probs: torch.Tensor, **kwargs) -> torch.Tensor:
    '\n\n        Args:\n            label_words_probs (:obj:`torch.Tensor`): The probability distribution of the label words with the shape of [``batch_size``, ``num_classes``, ``num_label_words_per_class``]\n\n        Returns:\n            :obj:`torch.Tensor`: The calibrated probability of label words.\n        '
    shape = label_words_probs.shape
    assert (self._calibrate_logits.dim() == 1), 'self._calibrate_logits are not 1-d tensor'
    calibrate_label_words_probs = self.normalize(self.project(self._calibrate_logits.unsqueeze(0), **kwargs))
    assert ((calibrate_label_words_probs.shape[1:] == label_words_probs.shape[1:]) and (calibrate_label_words_probs.shape[0] == 1)), 'shape not match'
    label_words_probs /= (calibrate_label_words_probs + 1e-15)
    norm = label_words_probs.reshape(shape[0], (- 1)).sum(dim=(- 1), keepdim=True)
    label_words_probs /= norm
    return label_words_probs
Args:
    label_words_probs (:obj:`torch.Tensor`): The probability distribution of the label words with the shape of [``batch_size``, ``num_classes``, ``num_label_words_per_class``]

Returns:
    :obj:`torch.Tensor`: The calibrated probability of label words.
def calibrate(self, label_words_probs: torch.Tensor, **kwargs) -> torch.Tensor:
    '\n\n        Args:\n            label_words_probs (:obj:`torch.Tensor`): The probability distribution of the label words with the shape of [``batch_size``, ``num_classes``, ``num_label_words_per_class``]\n\n        Returns:\n            :obj:`torch.Tensor`: The calibrated probability of label words.\n        '
    shape = label_words_probs.shape
    assert (self._calibrate_logits.dim() == 1), 'self._calibrate_logits are not 1-d tensor'
    calibrate_label_words_probs = self.normalize(self.project(self._calibrate_logits.unsqueeze(0), **kwargs))
    assert ((calibrate_label_words_probs.shape[1:] == label_words_probs.shape[1:]) and (calibrate_label_words_probs.shape[0] == 1)), 'shape not match'
    label_words_probs /= (calibrate_label_words_probs + 1e-15)
    norm = label_words_probs.reshape(shape[0], (- 1)).sum(dim=(- 1), keepdim=True)
    label_words_probs /= norm
    return label_words_probs