"git@developer.sourcefind.cn:OpenDAS/torch-scatter.git" did not exist on "5909accb96874b0eb21dbc952e98e0191467d7b9"
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, ...@@ -204,7 +204,5 @@ def set_config_v2(enable_xla=False,
def is_v2_0(): def is_v2_0():
"""Returns true if using tf 2.0.""" """Returns true if using tf 2.0."""
if hasattr(tf, 'contrib'): from tensorflow.python import tf2
return False return tf2.enabled()
else:
return True
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