aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/BUILD
diff options
context:
space:
mode:
authorGravatar Russell Power <power@google.com>2018-07-23 09:08:21 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-07-23 09:12:03 -0700
commit8048b3a53d5a919fef74874fcffbec9039e6acd1 (patch)
tree4544ae7df2fc34c0ef05cb76d97e4fa533691b75 /tensorflow/python/BUILD
parentefb8a6d2f89bdb307c23ea393df8701e61bedf9a (diff)
Destroy tf.Session when the session is closed.
Previously session destruction was delayed until the destructor for the Python session object. If the session ends up requiring the Python cycle collector for deallocation, it could end up persisting for a long, non-deterministic period. This can tie up resources and lead to out of memory issues. This change introduces a SessionRef which causes session.close() to block until all outstanding run operations are finished and tears down the underlying session. PiperOrigin-RevId: 205670577
Diffstat (limited to 'tensorflow/python/BUILD')
-rw-r--r--tensorflow/python/BUILD1
1 files changed, 1 insertions, 0 deletions
diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD
index 9c7f3b7b25..d45566c55e 100644
--- a/tensorflow/python/BUILD
+++ b/tensorflow/python/BUILD
@@ -3629,6 +3629,7 @@ tf_cuda_library(
"//tensorflow/core:graph",
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
+ "//tensorflow/core:session_ref",
"//third_party/py/numpy:headers",
"//third_party/python_runtime:headers",
],