Commit 712f473e authored by guptapriya's avatar guptapriya
Browse files

Change how TF 2 is checked

The current approach checks for presence of contrib. Sometimes this is not sufficient (for e..g when testing TF 1 + enable_v2_behavior=True which is what internal tests currently do)
parent 32fadf00
......@@ -204,7 +204,5 @@ def set_config_v2(enable_xla=False,
def is_v2_0():
"""Returns true if using tf 2.0."""
if hasattr(tf, 'contrib'):
return False
else:
return True
from tensorflow.python import tf2
return tf2.enabled()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment