Skip to content

Commit

Permalink
scalars: speed up test and mark as “medium” (#2327)
Browse files Browse the repository at this point in the history
Summary:
Addresses performance issues within Google: <http://b/134690650>. This
speeds up the test by 20–25%.

Test Plan:
That the test still passes suffices.

wchargin-branch: scalars-test-speed
  • Loading branch information
wchargin authored Jun 6, 2019
1 parent 30dbc10 commit 2990da4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tensorboard/plugins/scalar/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ py_library(

py_test(
name = "scalars_plugin_test",
size = "small",
size = "medium",
srcs = ["scalars_plugin_test.py"],
main = "scalars_plugin_test.py",
srcs_version = "PY2AND3",
Expand Down
5 changes: 3 additions & 2 deletions tensorboard/plugins/scalar/scalars_plugin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
@test_util.run_v1_only('Requires contrib for db writer or uses op.Placeholder')
class ScalarsPluginTest(tf.test.TestCase):

_STEPS = 99
_STEPS = 9

_LEGACY_SCALAR_TAG = 'ancient-values'
_SCALAR_TAG = 'simple-values'
Expand Down Expand Up @@ -101,9 +101,10 @@ def generate_run_to_db(self, experiment_name, run_name):

with tf.compat.v1.Session() as sess:
sess.run(tf.contrib.summary.summary_writer_initializer_op())
summaries = tf.contrib.summary.all_summary_ops()
for step in xrange(self._STEPS):
feed_dict = {global_step: step}
sess.run(tf.contrib.summary.all_summary_ops(), feed_dict=feed_dict)
sess.run(summaries, feed_dict=feed_dict)
sess.run(flush_op)

def testRoutesProvided(self):
Expand Down

0 comments on commit 2990da4

Please sign in to comment.