Ejemplo n.º 1
0
def test_on_hot_out_of_range():
    with pytest.raises(ValueError):
        utils.one_hot(4, 3)
Ejemplo n.º 2
0
def test_on_hot():
    r = utils.one_hot(4, 6)
    assert (r[[0, 1, 2, 3, 5]] == 0).all()
    assert r[4] == 1