diff --git a/tensorflow/python/tf2.py b/tensorflow/python/tf2.py index fd1c8c1757a..bc713d6e28b 100644 --- a/tensorflow/python/tf2.py +++ b/tensorflow/python/tf2.py @@ -24,7 +24,6 @@ from __future__ import print_function import os - _force_enable = None @@ -44,5 +43,5 @@ def enabled(): """Returns True iff TensorFlow 2.0 behavior should be enabled.""" if _force_enable is None: return os.getenv("TF2_BEHAVIOR", "0") != "0" - else: - return _force_enable + + return _force_enable