code: def test_TransformerDecoder_batch_beam_search_online(
      input_layer,
      normalize_before,
      use_output_layer,
      dtype,
      decoder_class,
      tmp_path,
  ):
      token_list = ["<blank>", "a", "b", "c", "unk", "<eos>"]
      vocab_size = len(token_list)
      encoder_output_size = 8
  
      decoder = decoder_class(
          vocab_size=vocab_size,
          encoder_output_size=encoder_output_size,
          input_layer=input_layer,
          normalize_before=normalize_before,
          use_output_layer=use_output_layer,
          linear_units=10,
      )
      ctc = CTC(
          odim=vocab_size, encoder_output_size=encoder_output_size
      )
      ctc.to(dtype)
      ctc_scorer = CTCPrefixScorer(ctc=ctc, eos=vocab_size - 1)
      beam = BatchBeamSearchOnlineSim(
          beam_size=3,
          vocab_size=vocab_size,
          weights={"test": 0.7, "ctc": 0.3},
          scorers={"test": decoder, "ctc": ctc_scorer},
          token_list=token_list,
          sos=vocab_size - 1,
          eos=vocab_size - 1,
          pre_beam_score_key=None,
      )
      cp = tmp_path / "config.yaml"
      yp = tmp_path / "dummy.yaml"
      with cp.open("w") as f:
          f.write("config: " + str(yp) + "\n")
      with yp.open("w") as f:
          f.write("encoder_conf:\n")
          f.write("    block_size: 4\n")
          f.write("    hop_size: 2\n")
          f.write("    look_ahead: 1\n")
      beam.set_streaming_config(cp)
      with cp.open("w") as f:
          f.write("encoder_conf:\n")
          f.write("    block_size: 4\n")
          f.write("    hop_size: 2\n")
          f.write("    look_ahead: 1\n")
      beam.set_streaming_config(cp)
      beam.set_block_size(4)
      beam.set_hop_size(2)
      beam.set_look_ahead(1)
      beam.to(dtype=dtype)
  
      enc = torch.randn(10, encoder_output_size).type(dtype)
      with torch.no_grad():
          beam(
              x=enc,
              maxlenratio=0.0,
              minlenratio=0.0,
          )
  
file_path: espnet/test/espnet2/asr/decoder/test_transformer_decoder.py
imports: import pytest
  import torch
  from espnet2.asr.ctc import CTC
  from espnet2.asr.decoder.transformer_decoder import DynamicConvolution2DTransformerDecoder, DynamicConvolutionTransformerDecoder, LightweightConvolution2DTransformerDecoder, LightweightConvolutionTransformerDecoder, TransformerDecoder
  from espnet.nets.batch_beam_search import BatchBeamSearch
  from espnet.nets.batch_beam_search_online_sim import BatchBeamSearchOnlineSim
  from espnet.nets.beam_search import BeamSearch
  from espnet.nets.scorers.ctc import CTCPrefixScorer
label_desc: Use image node_id 6 for calling a global function with example usage: test_TransformerDecoder_batch_beam_search_online(input_layer, normalize_before, use_output_layer, dtype, decoder_class, tmp_path) without return types