Unverified Commit b979a206 authored by Matt's avatar Matt Committed by GitHub
Browse files

Fix how we detect the TF package (#24255)

* Fix how we detect the TF package

* Add a comment as a talisman warding against future harm

* Actually put the comment in the right place
parent e64d99fa
...@@ -147,7 +147,9 @@ if FORCE_TF_AVAILABLE in ENV_VARS_TRUE_VALUES: ...@@ -147,7 +147,9 @@ if FORCE_TF_AVAILABLE in ENV_VARS_TRUE_VALUES:
_tf_available = True _tf_available = True
else: else:
if USE_TF in ENV_VARS_TRUE_AND_AUTO_VALUES and USE_TORCH not in ENV_VARS_TRUE_VALUES: if USE_TF in ENV_VARS_TRUE_AND_AUTO_VALUES and USE_TORCH not in ENV_VARS_TRUE_VALUES:
_tf_available = _is_package_available("tensorflow") # Note: _is_package_available("tensorflow") fails for tensorflow-cpu. Please test any changes to the line below
# with tensorflow-cpu to make sure it still works!
_tf_available = importlib.util.find_spec("tensorflow") is not None
if _tf_available: if _tf_available:
candidates = ( candidates = (
"tensorflow", "tensorflow",
......
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