class_docstr: Beam search implementation for Transducer.
class_docstr_tok: ["Beam","search","implementation","for","Transducer","."]
docstr: Perform beam search.
  
  Args:
      enc_out: Encoder output sequence. (T, D_enc)
  
  Returns:
      nbest_hyps: N-best decoding results
docstr_tok: ["Perform","beam","search",".","Args",":","enc_out",":","Encoder","output","sequence",".","(","T",",","D_enc",")","Returns",":","nbest_hyps",":","N-best","decoding","results"]
code: def __call__(
      self, enc_out: torch.Tensor
  ) -> Union[List[Hypothesis], List[ExtendedHypothesis]]:
      """Perform beam search.
  
      Args:
          enc_out: Encoder output sequence. (T, D_enc)
  
      Returns:
          nbest_hyps: N-best decoding results
  
      """
      self.decoder.set_device(enc_out.device)
  
      nbest_hyps = self.search_algorithm(enc_out)
  
      return nbest_hyps
  
file_path: espnet/espnet/nets/beam_search_transducer.py
imports: import logging
  from typing import List, Union
  import numpy
  import torch
  from espnet.nets.pytorch_backend.transducer.custom_decoder import CustomDecoder
  from espnet.nets.pytorch_backend.transducer.joint_network import JointNetwork
  from espnet.nets.pytorch_backend.transducer.rnn_decoder import RNNDecoder
  from espnet.nets.pytorch_backend.transducer.utils import create_lm_batch_states, init_lm_state, is_prefix, recombine_hyps, select_k_expansions, select_lm_state, subtract
  from espnet.nets.transducer_decoder_interface import ExtendedHypothesis, Hypothesis
label_desc: Use image node_id 2 for calling the BeamSearchTransducer obj's underlying member method code with example usage: obj.__call__(enc_out) and returns: nbest_hyps