(context_residual, rnn_type)
| 8 | @pytest.mark.parametrize("context_residual", [True, False]) |
| 9 | @pytest.mark.parametrize("rnn_type", ["lstm", "gru"]) |
| 10 | def test_RNNDecoder_backward(context_residual, rnn_type): |
| 11 | decoder = RNNDecoder(10, 12, context_residual=context_residual, rnn_type=rnn_type) |
| 12 | x = torch.randn(2, 9, 12) |
| 13 | x_lens = torch.tensor([9, 7], dtype=torch.long) |
| 14 | t = torch.randint(0, 10, [2, 4], dtype=torch.long) |
| 15 | t_lens = torch.tensor([4, 3], dtype=torch.long) |
| 16 | z_all, ys_in_lens = decoder(x, x_lens, t, t_lens) |
| 17 | z_all.sum().backward() |
| 18 | |
| 19 | |
| 20 | @pytest.mark.parametrize("context_residual", [True, False]) |
nothing calls this directly
no test coverage detected
searching dependent graphs…