class_docstr: Beam search decoder for RNN-T model with biasing support.
  
  Args:
      model (RNNT): RNN-T model to use.
      blank (int): index of blank token in vocabulary.
      temperature (float, optional): temperature to apply to joint network output.
          Larger values yield more uniform samples. (Default: 1.0)
      hypo_sort_key (Callable[[Hypothesis], float] or None, optional): callable that computes a score
          for a given hypothesis to rank hypotheses by. If ``None``, defaults to callable that returns
          hypothesis score normalized by token sequence length. (Default: None)
      step_max_tokens (int, optional): maximum number of tokens to emit per input time step. (Default: 100)
      trie (list, optional): the prefix tree for TCPGen biasing
      biasing (bool, optional): If true, do biasing, otherwise use standard RNN-T support
code: def _gen_next_token_probs(
      self,
      enc_out: torch.Tensor,
      hypos: List[Hypothesis],
      device: torch.device,
  ) -> torch.Tensor:
      one_tensor = torch.tensor([1], device=device)
      predictor_out = torch.stack(
          [_get_hypo_predictor_out(h) for h in hypos], dim=0
      )
      if self.dobiasing:
          # Get valid subset of wordpieces
          trie_masks = torch.stack(
              [self._get_trie_mask(_get_hypo_trie(h)) for h in hypos],
              dim=0,
          )
          trie_masks = trie_masks.to(enc_out.device).unsqueeze(
              1
          )  # beam_width, 1, nchars
          # Determine if there is any paths on the trie
          genprob_masks = torch.tensor(
              [
                  self._get_generation_prob(_get_hypo_trie(h))
                  for h in hypos
              ]
          )  # beam_width
          genprob_masks = genprob_masks.to(enc_out.device)
          # Forward TCPGen component
          last_tokens = (
              torch.tensor([_get_hypo_tokens(h)[-1] for h in hypos])
              .unsqueeze(-1)
              .to(enc_out.device)
          )
          hptr, tcpgen_dist = self.model.forward_tcpgen(
              last_tokens, trie_masks, enc_out
          )
      else:
          hptr = None
      # hptr sent to joiner, if deepbiasing is True joiner will use it
      joined_out, _, joined_activation = self.model.join(
          enc_out,
          one_tensor,
          predictor_out,
          torch.tensor([1] * len(hypos), device=device),
          hptr=hptr,
      )  # [beam_width, 1, 1, num_tokens]
      if self.dobiasing:
          p_gen = torch.sigmoid(
              self.model.pointer_gate(
                  torch.cat((joined_activation, hptr), dim=-1)
              )
          )
          p_gen = p_gen.masked_fill(
              genprob_masks.view(p_gen.size(0), 1, 1, 1), 0
          )
          model_tu = torch.softmax(joined_out / self.temperature, dim=3)
          # assuming last token is blank
          p_not_null = 1.0 - model_tu[:, :, :, -1:]
          ptr_dist_fact = (
              torch.cat(
                  [
                      tcpgen_dist[:, :, :, :-2],
                      tcpgen_dist[:, :, :, -1:],
                  ],
                  dim=-1,
              )
              * p_not_null
          )
          ptr_gen_complement = tcpgen_dist[:, :, :, -1:] * p_gen
          p_partial = ptr_dist_fact[:, :, :, :-1] * p_gen + model_tu[
              :, :, :, :-1
          ] * (1 - p_gen + ptr_gen_complement)
          p_final = torch.cat(
              [p_partial, model_tu[:, :, :, -1:]], dim=-1
          )
          joined_out = torch.log(p_final)
      else:
          joined_out = torch.nn.functional.log_softmax(
              joined_out / self.temperature, dim=3
          )
      return joined_out[:, 0, 0]
  
imports: from typing import Callable, Dict, List, Optional, Tuple
  import torch
  from torchaudio.models import RNNT
  from torchaudio.prototype.models.rnnt import TrieNode
label_desc: Use image node_id 5 for calling the RNNTBeamSearchBiasing obj's underlying member method code with example usage: obj._gen_next_token_probs(enc_out, hypos, device) and returns: joined_out