tfdbg: add Session.sess_str check to Session wrapper base class
Change: 144464664
This commit is contained in:
parent
f1a6dc18fe
commit
7c96eadae6
@ -325,10 +325,17 @@ class BaseDebugWrapperSession(session.SessionInterface):
|
|||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
ValueError: On invalid `OnSessionInitAction` value.
|
ValueError: On invalid `OnSessionInitAction` value.
|
||||||
|
NotImplementedError: If a non-DirectSession sess object is received.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
_check_type(sess, session.BaseSession)
|
_check_type(sess, session.BaseSession)
|
||||||
|
|
||||||
|
# TODO(cais): Remove this check once tfdbg is integrated with GrpcSession.
|
||||||
|
if sess.sess_str:
|
||||||
|
raise NotImplementedError(
|
||||||
|
"Non-DirectSession support is not available from TensorFlow "
|
||||||
|
"Debugger yet (sess_str=%s)" % sess.sess_str)
|
||||||
|
|
||||||
# The session being wrapped.
|
# The session being wrapped.
|
||||||
self._sess = sess
|
self._sess = sess
|
||||||
|
|
||||||
|
@ -311,6 +311,18 @@ class DebugWrapperSessionTest(test_util.TensorFlowTestCase):
|
|||||||
self._observer)
|
self._observer)
|
||||||
wrapper.close()
|
wrapper.close()
|
||||||
|
|
||||||
|
def testUsingNonDirectSessionRaisesNotImplementedError(self):
|
||||||
|
# TODO(cais): Remove this test once tfdbg is integrated with GrpcSession.
|
||||||
|
fake_non_direct_session = session.Session()
|
||||||
|
fake_non_direct_session._target = "foo"
|
||||||
|
|
||||||
|
with self.assertRaisesRegexp(
|
||||||
|
NotImplementedError,
|
||||||
|
r"Non-DirectSession support is not available from TensorFlow Debugger "
|
||||||
|
r"yet \(sess_str=foo\)"):
|
||||||
|
TestDebugWrapperSession(
|
||||||
|
fake_non_direct_session, self._dump_root, self._observer)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
googletest.main()
|
googletest.main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user