Commit 8048b3a5 authored by Russell Power's avatar Russell Power Committed by TensorFlower Gardener
Browse files

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
parent efb8a6d2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment