Make graph construction work while graph is being concurrently run.
authorSkye Wanderman-Milne <skyewm@google.com>
Wed, 7 Mar 2018 01:19:36 +0000 (17:19 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Wed, 7 Mar 2018 01:23:35 +0000 (17:23 -0800)
commit9c3cf322a3051339899ffb74c33533f60c0c2d8e
treebe3c72e843a9178be50c0e5a791686d1253cea82
parent6e99d56489b4e6c3176fa1199d4270b6439a22fe
Make graph construction work while graph is being concurrently run.

The overall approach is to use Graph._lock to synchronize Session.run calls and construction methods that rely on graph mutation. We don't want to synchronize the actual running of the graph, only the Extend call, so this change exposes an ExtendSession method to the Python API and disables extending automatically in TF_SessionRun.

PiperOrigin-RevId: 188106818
tensorflow/c/c_api.cc
tensorflow/c/c_api_internal.h
tensorflow/c/python_api.cc
tensorflow/c/python_api.h
tensorflow/python/client/session.py
tensorflow/python/client/session_test.py
tensorflow/python/client/tf_session.i
tensorflow/python/framework/importer.py
tensorflow/python/framework/ops.py
tensorflow/python/ops/control_flow_ops.py
tensorflow/python/ops/gradients_impl.py