From b419bc4a56b96982e666c3d072ac4aa898f9b2d4 Mon Sep 17 00:00:00 2001 From: shimon-armis Date: Sat, 1 Apr 2023 23:58:14 +0300 Subject: [PATCH] twml/util: Use a shortened condition This commit enhances an assertion on log level by using a shortened version for range comparison: x <= y <= z Instead of y => x and y <= z Signed-off-by: shimon-armis --- twml/twml/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twml/twml/util.py b/twml/twml/util.py index cd7679a6f..2be3753d4 100644 --- a/twml/twml/util.py +++ b/twml/twml/util.py @@ -481,7 +481,7 @@ def set_tensorflow_log_level(log_level): Note that tf.Print output are INFO logs, so setting log_level above 0 would hide output from tf.Print. """ - assert isinstance(log_level, int) and log_level >= 0 and log_level <= 3 + assert isinstance(log_level, int) and 0 <= log_level <= 3 os.environ['TF_CPP_MIN_LOG_LEVEL'] = str(log_level)