code: def test_RNNDecoder_beam_search(context_residual, rnn_type, dtype):
      token_list = ["<blank>", "a", "b", "c", "unk", "<eos>"]
      vocab_size = len(token_list)
      encoder_output_size = 4
      decoder = RNNDecoder(
          vocab_size,
          encoder_output_size=encoder_output_size,
          context_residual=context_residual,
          rnn_type=rnn_type,
      )
      beam = BeamSearch(
          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,
          )
  
imports: import pytest
  import torch
  from espnet2.asr.decoder.rnn_decoder import RNNDecoder
  from espnet.nets.beam_search import BeamSearch
label_desc: Use image node_id 4 for calling a global function with example usage: test_RNNDecoder_beam_search(context_residual, rnn_type, dtype) without return types