def METHOD_NAME(self, log_probs, log_probs_length):
    probs_list = log_probs
    if self.input_tensor:
        probs = torch.exp(log_probs)
        probs_list = []
        for i, prob in enumerate(probs):
            probs_list.append(prob[: log_probs_length[i], :])
    res = self.beam_search_func(
        probs_list,
        self.vocab,
        beam_size=self.beam_width,
        num_processes=self.num_cpus,
        ext_scoring_func=self.scorer,
        cutoff_prob=self.cutoff_prob,
        cutoff_top_n=self.cutoff_top_n,
    )
    return res