Commit fc624716 authored by Morgan Funtowicz's avatar Morgan Funtowicz
Browse files

Renaming framework env variables flags from NO_ to USE_

parent f516cf39
...@@ -27,8 +27,9 @@ from contextlib import contextmanager ...@@ -27,8 +27,9 @@ from contextlib import contextmanager
logger = logging.getLogger(__name__) # pylint: disable=invalid-name logger = logging.getLogger(__name__) # pylint: disable=invalid-name
try: try:
if 'NO_TF' in os.environ and os.environ['NO_TF'].upper() in ('1', 'ON'): os.environ.setdefault('USE_TF', 'YES')
logger.info("Found NO_TF, disabling TensorFlow") if os.environ['USE_TF'].upper() in ('1', 'ON', 'YES'):
logger.info("USE_TF override through env variable, disabling Tensorflow")
_tf_available = False _tf_available = False
else: else:
import tensorflow as tf import tensorflow as tf
...@@ -39,8 +40,9 @@ except (ImportError, AssertionError): ...@@ -39,8 +40,9 @@ except (ImportError, AssertionError):
_tf_available = False # pylint: disable=invalid-name _tf_available = False # pylint: disable=invalid-name
try: try:
if 'NO_TORCH' in os.environ and os.environ['NO_TORCH'].upper() in ('1', 'ON'): os.environ.setdefault('USE_TORCH', 'YES')
logger.info("Found NO_TORCH, disabling PyTorch") if os.environ['USE_TORCH'].upper() in ('1', 'ON', 'YES'):
logger.info("USE_TORCH override through env variable, disabling PyTorch")
_torch_available = False _torch_available = False
else: else:
import torch import torch
......
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