code: def test_TransformerDecoder_batch_beam_search(
      input_layer,
      normalize_before,
      use_output_layer,
      dtype,
      decoder_class,
  ):
      token_list = ["<blank>", "a", "b", "c", "unk", "<eos>"]
      vocab_size = len(token_list)
      encoder_output_size = 4
  
      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,
      )
      beam = BatchBeamSearch(
          beam_size=3,
          vocab_size=vocab_size,
          weights={"test": 1.0},
          scorers={"test": decoder},
          token_list=token_list,
          sos=vocab_size - 1,
          eos=vocab_size - 1,
          pre_beam_score_key=None,
      )
      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 5 for calling a global function with example usage: test_TransformerDecoder_batch_beam_search(input_layer, normalize_before, use_output_layer, dtype, decoder_class) without return types