diff options
author | 2018-07-13 11:05:09 -0700 | |
---|---|---|
committer | 2018-07-13 11:08:47 -0700 | |
commit | d98b99d1cd4337ee11e7cbc4c9b6324f0e381502 (patch) | |
tree | 5c7e4ce26d8070bbc51a3bd36964aa3e1441700d /tensorflow/core/common_runtime/session_test.cc | |
parent | b5b5cc0e248b6fbd5025765f592a43af158a1cb2 (diff) |
Add version of SessionFactory::NewSession that returns Status.
This causes DirectSession to report a better error message if there is an error initializing GPUs.
PiperOrigin-RevId: 204498143
Diffstat (limited to 'tensorflow/core/common_runtime/session_test.cc')
-rw-r--r-- | tensorflow/core/common_runtime/session_test.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tensorflow/core/common_runtime/session_test.cc b/tensorflow/core/common_runtime/session_test.cc index feaf29c7bb..1fa5aad60c 100644 --- a/tensorflow/core/common_runtime/session_test.cc +++ b/tensorflow/core/common_runtime/session_test.cc @@ -47,8 +47,10 @@ class FakeSessionFactory : public SessionFactory { return str_util::StartsWith(options.target, "fake"); } - Session* NewSession(const SessionOptions& options) override { - return nullptr; + Status NewSession(const SessionOptions& options, + Session** out_session) override { + *out_session = nullptr; + return Status::OK(); } }; class FakeSessionRegistrar { |