aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Rohan Jain <rohanj@google.com>2017-11-02 15:28:17 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-11-02 15:32:08 -0700
commitb78c7d72630e2f5d1a85314ff6e6cc496cde80e9 (patch)
tree7b7d9c42fa5bbf982b52162d3a852d0a2caccf14
parent88917888f509e3e61ffe632534476e7b09d3326a (diff)
Deleting the function_buffer_resource explicitly when we're done using it.
PiperOrigin-RevId: 174389872
-rw-r--r--tensorflow/contrib/data/python/kernel_tests/BUILD1
-rw-r--r--tensorflow/contrib/data/python/kernel_tests/prefetching_ops_test.py4
2 files changed, 5 insertions, 0 deletions
diff --git a/tensorflow/contrib/data/python/kernel_tests/BUILD b/tensorflow/contrib/data/python/kernel_tests/BUILD
index 424eb19852..e8ebd0e69b 100644
--- a/tensorflow/contrib/data/python/kernel_tests/BUILD
+++ b/tensorflow/contrib/data/python/kernel_tests/BUILD
@@ -428,6 +428,7 @@ py_test(
"//tensorflow/python:client_testlib",
"//tensorflow/python:constant_op",
"//tensorflow/python:dtypes",
+ "//tensorflow/python:resource_variable_ops",
],
)
diff --git a/tensorflow/contrib/data/python/kernel_tests/prefetching_ops_test.py b/tensorflow/contrib/data/python/kernel_tests/prefetching_ops_test.py
index 539c6f2155..dc3e38db59 100644
--- a/tensorflow/contrib/data/python/kernel_tests/prefetching_ops_test.py
+++ b/tensorflow/contrib/data/python/kernel_tests/prefetching_ops_test.py
@@ -29,6 +29,7 @@ from tensorflow.python.framework import dtypes
from tensorflow.python.framework import function
from tensorflow.python.framework import ops
from tensorflow.python.framework import test_util
+from tensorflow.python.ops import resource_variable_ops
from tensorflow.python.platform import test
@@ -85,6 +86,9 @@ class StagingAreaOpsTest(test.TestCase):
self._event.wait()
elem = sess.run(prefetch_op)
self.assertEqual(elem, [5.0])
+ sess.run(
+ resource_variable_ops.destroy_resource_op(
+ buffer_resource_handle, ignore_lookup_error=True))
def testSameDeviceCPU(self):
self._prefetch_fn_helper("same_device_cpu",