Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
Relax TF_KERAS boolean (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainBrault authored and CyberZHG committed Sep 23, 2019
1 parent ea1b9cc commit 0b3a96f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion keras_lookahead/__init__.py
@@ -1,3 +1,3 @@
from .optimizers import *

__version__ = '0.7.0'
__version__ = '0.8.0'
7 changes: 5 additions & 2 deletions keras_lookahead/backend.py
@@ -1,5 +1,8 @@
import os

from distutils.util import strtobool


__all__ = [
'keras', 'utils', 'activations', 'applications', 'backend', 'datasets', 'engine',
'layers', 'preprocessing', 'wrappers', 'callbacks', 'constraints', 'initializers',
Expand All @@ -9,11 +12,11 @@
TF_KERAS = False
EAGER_MODE = False

if os.environ.get('TF_KERAS', '0') != '0':
if strtobool(os.environ.get('TF_KERAS', '0')):
import tensorflow as tf
from tensorflow.python import keras
TF_KERAS = True
if os.environ.get('TF_EAGER', '0') != '0':
if strtobool(os.environ.get('TF_EAGER', '0')):
try:
tf.enable_eager_execution()
raise AttributeError()
Expand Down

0 comments on commit 0b3a96f

Please sign in to comment.