def METHOD_NAME(decoder_class, decoder_opts, search_opts):
    token_list = ["<blank>", "a", "b", "c"]
    vocab_size = len(token_list)
    encoder_size = 4
    if decoder_class in (MEGADecoder, RWKVDecoder):
        if decoder_class == RWKVDecoder and not torch.cuda.is_available():
            pytest.skip("A GPU is required for WKV kernel computation")
        decoder = decoder_class(vocab_size, block_size=4, **decoder_opts)
    else:
        decoder = decoder_class(vocab_size, embed_size=4, **decoder_opts)
    joint_net = JointNetwork(vocab_size, encoder_size, 4, joint_space_size=2)
    lm = search_opts.pop(
        "lm", SequentialRNNLM(vocab_size, unit=8, nlayers=1, rnn_type="lstm")
    )
    beam = BeamSearchTransducer(
        decoder,
        joint_net,
        beam_size=2,
        lm=lm,
        **search_opts,
    )
    enc_out = torch.randn(30, encoder_size)
    with torch.no_grad():
        _ = beam(enc_out)