Skip to content

Commit

Permalink
chore(tests): check invalid inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeertmans committed Jul 26, 2023
1 parent 3496c0e commit 86b6dd1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,12 @@ def test_activation(function, jax_fun, alpha):
got = activation(x, alpha=alpha, function=function)
chex.assert_trees_all_close(expected, got)
chex.assert_trees_all_equal_shapes_and_dtypes(expected, got)


@pytest.mark.parametrize(
("function",), [("relu",), ("SIGMOID",), ("HARD_SIGMOID",), ("hard-sigmoid",)]
)
def test_invalid_activation(function):
with pytest.raises(ValueError) as e:
activation(1.0, function=function)
assert "Unknown" in str(e)

0 comments on commit 86b6dd1

Please sign in to comment.