Skip to content
Merged
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
16 changes: 1 addition & 15 deletions tensorboard/plugins/mesh/mesh_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
18 changes: 2 additions & 16 deletions tensorboard/plugins/mesh/mesh_plugin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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())


Expand Down