Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal change #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
from absl import flags
from tensorboard_plugin_fairness_indicators import summary_v2
import tensorflow.compat.v1 as tf
import tensorflow.compat.v2 as tf2

tf.compat.v1.enable_eager_execution()
tf = tf.compat.v2
tf.enable_eager_execution()
tf = tf2

FLAGS = flags.FLAGS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from tensorboard_plugin_fairness_indicators import plugin
from tensorboard_plugin_fairness_indicators import summary_v2
import tensorflow.compat.v1 as tf
import tensorflow.compat.v2 as tf2
import tensorflow_model_analysis as tfma
from tensorflow_model_analysis.eval_saved_model.example_trainers import linear_classifier
from werkzeug import test as werkzeug_test
Expand All @@ -39,8 +40,8 @@
except ImportError:
import mock # pylint: disable=g-import-not-at-top,unused-import

tf.compat.v1.enable_eager_execution()
tf = tf.compat.v2
tf.enable_eager_execution()
tf = tf2


class PluginTest(tf.test.TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
tf2 = None

try:
tf.compat.v1.enable_eager_execution()
tf.enable_eager_execution()
except AttributeError:
# TF 2.0 doesn't have this symbol because eager is the default.
pass
Expand All @@ -49,7 +49,7 @@ def _write_summary(self, eval_result_output_dir):
def _get_event(self):
event_files = sorted(glob.glob(os.path.join(self.get_temp_dir(), '*')))
self.assertEqual(len(event_files), 1)
events = list(tf.compat.v1.train.summary_iterator(event_files[0]))
events = list(tf.train.summary_iterator(event_files[0]))
# Expect a boilerplate event for the file_version, then the summary one.
self.assertEqual(len(events), 2)
return events[1]
Expand Down