Skip to content

Commit

Permalink
added test for normalize_data_format in keras_utils (#1818)
Browse files Browse the repository at this point in the history
* added test for normalize_data_format in keras_utils

* change after review
  • Loading branch information
amascia authored May 13, 2020
1 parent 88ec116 commit c05a3d6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tensorflow_addons/utils/tests/keras_utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
from tensorflow_addons.utils import keras_utils


def test_normalize_data_format():
assert keras_utils.normalize_data_format("Channels_Last") == "channels_last"
assert keras_utils.normalize_data_format("CHANNELS_FIRST") == "channels_first"

with pytest.raises(ValueError, match="The `data_format` argument must be one of"):
keras_utils.normalize_data_format("invalid")


def test_normalize_tuple():
assert (2, 2, 2) == keras_utils.normalize_tuple(2, n=3, name="strides")
assert (2, 1, 2) == keras_utils.normalize_tuple((2, 1, 2), n=3, name="strides")
Expand Down

0 comments on commit c05a3d6

Please sign in to comment.