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

Function test_score

test/espnet2/asr/decoder/test_linear_decoder.py:24–28  ·  view source on GitHub ↗
(vocab_size, encoder_output_size, pooling)

Source from the content-addressed store, hash-verified

22@pytest.mark.parametrize("encoder_output_size", [4, 21])
23@pytest.mark.parametrize("pooling", ["mean", "max", "CLS"])
24def test_score(vocab_size, encoder_output_size, pooling):
25 decoder = LinearDecoder(vocab_size, encoder_output_size, pooling)
26 x = torch.randn(10, encoder_output_size)
27 score, _ = decoder.score(ys=None, state=None, x=x)
28 assert score.shape == (vocab_size,), score.shape

Callers

nothing calls this directly

Calls 2

scoreMethod · 0.95
LinearDecoderClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…