def test_clear_update_buffer(): trainer = create_rl_trainer() trainer.training_buffer = construct_fake_buffer() trainer.training_buffer.append_update_buffer(2, batch_size=None, training_length=2) trainer.clear_update_buffer() for _, arr in trainer.training_buffer.update_buffer.items(): assert len(arr) == 0
def test_clear_update_buffer(): trainer = create_rl_trainer() trainer.update_buffer = construct_fake_buffer(0) trainer._clear_update_buffer() for _, arr in trainer.update_buffer.items(): assert len(arr) == 0