class_docstr: Online beam search implementation.
  
  This simulates streaming decoding.
  It requires encoded features of entire utterance and
  extracts block by block from it as it shoud be done
  in streaming processing.
  This is based on Tsunoo et al, "STREAMING TRANSFORMER ASR
  WITH BLOCKWISE SYNCHRONOUS BEAM SEARCH"
  (https://arxiv.org/abs/2006.14941).
docstr: Initialize beam search.
docstr_tok: ["Initialize","beam","search","."]
code: def __init__(
      self,
      *args,
      block_size=40,
      hop_size=16,
      look_ahead=16,
      disable_repetition_detection=False,
      encoded_feat_length_limit=0,
      decoder_text_length_limit=0,
      incremental_decode=False,
      time_sync=False,
      ctc=None,
      hold_n=0,
      transducer_conf=None,
      joint_network=None,
      **kwargs,
  ):
      """Initialize beam search."""
      super().__init__(*args, **kwargs)
      self.block_size = block_size
      self.hop_size = hop_size
      self.look_ahead = look_ahead
      self.disable_repetition_detection = disable_repetition_detection
      self.encoded_feat_length_limit = encoded_feat_length_limit
      self.decoder_text_length_limit = decoder_text_length_limit
      self.incremental_decode = incremental_decode
      self.time_sync = time_sync
      self.ctc = ctc
      self.hold_n = hold_n
  
      if time_sync:
          if transducer_conf is not None:
              self.time_sync_search = BeamSearchTransducerStreaming(
                  decoder=self.scorers["decoder"],
                  joint_network=joint_network,
                  beam_size=self.beam_size,
                  token_list=self.token_list,
                  hold_n=hold_n,
                  **transducer_conf,
              )
              del self.scorers["decoder"]
              self.t = 0
          else:
              scorers = self.scorers.copy()
              scorers["ctc"] = ctc
              self.time_sync_search = BeamSearchTimeSyncStreaming(
                  beam_size=self.beam_size,
                  weights=self.weights,
                  scorers=scorers,
                  sos=self.sos,
                  token_list=self.token_list,
                  hold_n=hold_n,
              )
              self.t = 0
  
      self.reset()
  
imports: import logging
  from typing import Any
  from typing import Dict
  from typing import List
  from typing import Tuple
  import torch
  from espnet2.asr.transducer.beam_search_transducer_streaming import BeamSearchTransducerStreaming
  from espnet.nets.batch_beam_search import BatchBeamSearch
  from espnet.nets.batch_beam_search import BatchHypothesis
  from espnet.nets.beam_search import Hypothesis
  from espnet.nets.beam_search_timesync_streaming import BeamSearchTimeSyncStreaming
  from espnet.nets.e2e_asr_common import end_detect
label_desc: Use image node_id 1 to create a new BatchBeamSearchOnline object from inherited base classes: BatchBeamSearch with example: obj = BatchBeamSearchOnline()