code: def prob_multinomial(self, logits, n):
      # Convert to probability
      probas = F.softmax(logits, dim=-1)
  
      # Draw candidates
      num_sample = min(
          n, torch.nonzero(probas, as_tuple=False).size(0)
      )  # Number of potential candidate is small when top_k/ top_p are used.
      filtered_top_n_ids = torch.multinomial(
          probas, num_samples=num_sample, replacement=False
      ).tolist()
  
      if self.optimize["return_proba"]:
          top_n_probas = [probas[_id] for _id in filtered_top_n_ids]
          return filtered_top_n_ids, top_n_probas
  
      return filtered_top_n_ids, None
  
imports: import numpy
  import string
  import nlpaug.util.selection.filtering
label_desc: Use image node_id 21 for calling the LanguageModels obj's underlying member method code with example usage: obj.prob_multinomial(logits, n) and returns: filtered_top_n_ids,  None, filtered_top_n_ids,  top_n_probas