(batch_size, input_size, hidden_size, init_hidden)
| 20 | [(3, 10, 20, True), (3, 10, 20, False), (1, 10, 20, False)], |
| 21 | ) |
| 22 | def test_rnn_cell(batch_size, input_size, hidden_size, init_hidden): |
| 23 | rnn_cell = RNNCell(input_size, hidden_size) |
| 24 | x = mge.random.normal(size=(batch_size, input_size)) |
| 25 | if init_hidden: |
| 26 | h = F.zeros(shape=(batch_size, hidden_size)) |
| 27 | else: |
| 28 | h = None |
| 29 | h_new = rnn_cell(x, h) |
| 30 | assert_tuple_equal(h_new.shape, (batch_size, hidden_size)) |
| 31 | |
| 32 | |
| 33 | @pytest.mark.skipif(get_device_count("gpu") > 0, reason="no algorithm on cuda") |
nothing calls this directly
no test coverage detected