MCPcopy Create free account
hub / github.com/espnet/espnet / test_RNNDecoder_init_state

Function test_RNNDecoder_init_state

test/espnet2/asr/decoder/test_rnn_decoder.py:22–27  ·  view source on GitHub ↗
(context_residual, rnn_type)

Source from the content-addressed store, hash-verified

20@pytest.mark.parametrize("context_residual", [True, False])
21@pytest.mark.parametrize("rnn_type", ["lstm", "gru"])
22def test_RNNDecoder_init_state(context_residual, rnn_type):
23 decoder = RNNDecoder(10, 12, context_residual=context_residual, rnn_type=rnn_type)
24 x = torch.randn(9, 12)
25 state = decoder.init_state(x)
26 t = torch.randint(0, 10, [4], dtype=torch.long)
27 decoder.score(t, state, x)
28
29
30def test_RNNDecoder_invalid_type():

Callers

nothing calls this directly

Calls 3

init_stateMethod · 0.95
scoreMethod · 0.95
RNNDecoderClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…