aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/summary
diff options
context:
space:
mode:
authorGravatar Allen Lavoie <allenl@google.com>2018-06-25 12:19:10 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-06-25 12:22:14 -0700
commit044fe4cbbfd0f83525e828b8f951114e3e6a8939 (patch)
tree8a862e9b22386b5b2953c4086ddfd941decf10b4 /tensorflow/contrib/summary
parentec3e49717c89789bf6a9aa8f747319fec0755ef7 (diff)
Fix some summary collection leaks when executing eagerly
Also modifies the assert_no_new_pyobjects_executing_eagerly decorator to explicitly check collections. Preivously it just used gc.get_objects, which misses anything not subject to garbage collection. (Maybe we should disable collections entirely when executing eagerly?) Fixes #20218. (to be verified) PiperOrigin-RevId: 201997703
Diffstat (limited to 'tensorflow/contrib/summary')
-rw-r--r--tensorflow/contrib/summary/summary_ops_test.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tensorflow/contrib/summary/summary_ops_test.py b/tensorflow/contrib/summary/summary_ops_test.py
index f1ef218e74..3e41e3d0b4 100644
--- a/tensorflow/contrib/summary/summary_ops_test.py
+++ b/tensorflow/contrib/summary/summary_ops_test.py
@@ -81,6 +81,19 @@ class EagerFileTest(test_util.TensorFlowTestCase):
# test here that we're calling them correctly.
self.assertTrue(gfile.Exists(logdir))
+ @test_util.assert_no_new_pyobjects_executing_eagerly
+ def testEagerMemory(self):
+ training_util.get_or_create_global_step()
+ logdir = self.get_temp_dir()
+ with summary_ops.create_file_writer(
+ logdir, max_queue=0,
+ name='t0').as_default(), summary_ops.always_record_summaries():
+ summary_ops.generic('tensor', 1, '')
+ summary_ops.scalar('scalar', 2.0)
+ summary_ops.histogram('histogram', [1.0])
+ summary_ops.image('image', [[[[1.0]]]])
+ summary_ops.audio('audio', [[1.0]], 1.0, 1)
+
def testDefunSummarys(self):
training_util.get_or_create_global_step()
logdir = tempfile.mkdtemp()