class_docstr: The basic manually defined verbalizer class, this class is inherited from the :obj:`Verbalizer` class.
  
  Args:
      tokenizer (:obj:`PreTrainedTokenizer`): The tokenizer of the current pre-trained model to point out the vocabulary.
      classes (:obj:`List[Any]`): The classes (or labels) of the current task.
      label_words (:obj:`Union[List[str], List[List[str]], Dict[List[str]]]`, optional): The label words that are projected by the labels.
      prefix (:obj:`str`, optional): The prefix string of the verbalizer (used in PLMs like RoBERTa, which is sensitive to prefix space)
      multi_token_handler (:obj:`str`, optional): The handling strategy for multiple tokens produced by the tokenizer.
      post_log_softmax (:obj:`bool`, optional): Whether to apply log softmax post processing on label_logits. Default to True.
docstr: 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.
docstr_tok: ["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","."]
code: def calibrate(
      self, label_words_probs: torch.Tensor, **kwargs
  ) -> torch.Tensor:
      r"""
  
      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.
      """
      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
      # normalize # TODO Test the performance
      norm = label_words_probs.reshape(shape[0], -1).sum(
          dim=-1, keepdim=True
      )  # TODO Test the performance of detaching()
      label_words_probs = label_words_probs.reshape(shape[0], -1) / norm
      label_words_probs = label_words_probs.reshape(*shape)
      return label_words_probs
  
imports: import json
  from transformers.tokenization_utils import PreTrainedTokenizer
  from yacs.config import CfgNode
  from openprompt.data_utils import InputFeatures
  import re
  from openprompt import Verbalizer
  from typing import *
  import torch
  import torch.nn
  import torch.nn.functional
  from openprompt.utils.logging import logger
label_desc: Use image node_id 9 for calling the ManualVerbalizer obj's underlying member method code with example usage: obj.calibrate(label_words_probs) and returns: label_words_probs