diff --git a/tensorboard/plugins/mesh/mesh_plugin.py b/tensorboard/plugins/mesh/mesh_plugin.py index 2650172a85..84a86676af 100644 --- a/tensorboard/plugins/mesh/mesh_plugin.py +++ b/tensorboard/plugins/mesh/mesh_plugin.py @@ -116,21 +116,7 @@ def get_plugin_apps(self): } def is_active(self): - """Determines whether this plugin is active. - - This plugin is only active if TensorBoard sampled any summaries - relevant to the mesh plugin. - - Returns: - Whether this plugin is active. - """ - all_runs = self._multiplexer.PluginRunToTagToContent( - MeshPlugin.plugin_name - ) - - # The plugin is active if any of the runs has a tag relevant - # to the plugin. - return bool(self._multiplexer and any(six.itervalues(all_runs))) + return False # `list_plugins` as called by TB core suffices def frontend_metadata(self): return base_plugin.FrontendMetadata(element_name="mesh-dashboard") diff --git a/tensorboard/plugins/mesh/mesh_plugin_test.py b/tensorboard/plugins/mesh/mesh_plugin_test.py index b3df05ce7d..bbe5ce110f 100644 --- a/tensorboard/plugins/mesh/mesh_plugin_test.py +++ b/tensorboard/plugins/mesh/mesh_plugin_test.py @@ -23,6 +23,7 @@ import numpy as np import tensorflow as tf import time +from unittest import mock from werkzeug import test as werkzeug_test from werkzeug import wrappers @@ -36,13 +37,6 @@ from tensorboard.plugins.mesh import plugin_data_pb2 from tensorboard.plugins.mesh import test_utils from tensorboard.util import test_util as tensorboard_test_util -from mock import patch - -try: - # python version >= 3.3 - from unittest import mock -except ImportError: - import mock # pylint: disable=unused-import class MeshPluginTest(tf.test.TestCase): @@ -129,7 +123,7 @@ def setUp(self): if step % 2 == 0 else mesh_no_color_extended ) - with patch.object(time, "time", return_value=step): + with mock.patch.object(time, "time", return_value=step): writer.add_summary( sess.run( merged_summary_op, @@ -264,14 +258,6 @@ def testsEventsAlwaysSortedByStep(self): self.assertLessEqual(metadata[i - 1]["step"], metadata[i]["step"]) def testIsActive(self): - self.assertTrue(self.plugin.is_active()) - - @mock.patch.object( - event_multiplexer.EventMultiplexer, - "PluginRunToTagToContent", - return_value={}, - ) - def testIsInactive(self, get_random_mesh_stub): self.assertFalse(self.plugin.is_active())