diff options
author | 2017-04-04 06:26:06 -0800 | |
---|---|---|
committer | 2017-04-04 07:50:42 -0700 | |
commit | ac3c7686b9103d2b599650c073f9ac9d474559e4 (patch) | |
tree | c2c21c3111e24df4ecff86c345cfb2a8e82f4dc9 | |
parent | 91685c11338f9f6821baf887388d1d93e1818f96 (diff) |
[TF:XLA] Failures from ComputationBuilder::IsConstant() and ComputationBuilder::ComputeConstant() should not be persistent.
The reason to note failures via first_error_ is so that most methods can defer failure reporting until Build() time. However this makes no sense for methods such as ComputeConstant() that return a Status already -- such methods can just return their errors directly without "polluting" other callers.
Change: 152129004
-rw-r--r-- | tensorflow/compiler/xla/client/computation_builder.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tensorflow/compiler/xla/client/computation_builder.cc b/tensorflow/compiler/xla/client/computation_builder.cc index 88efd87d1c..22a7068146 100644 --- a/tensorflow/compiler/xla/client/computation_builder.cc +++ b/tensorflow/compiler/xla/client/computation_builder.cc @@ -1229,8 +1229,7 @@ StatusOr<bool> ComputationBuilder::IsConstant( VLOG(2) << "done with request"; if (!s.ok()) { - NoteError(s); - return first_error_; + return s; } return response.is_constant(); } @@ -1255,8 +1254,7 @@ StatusOr<std::unique_ptr<GlobalData>> ComputationBuilder::ComputeConstant( VLOG(2) << "done with request"; if (!s.ok()) { - NoteError(s); - return first_error_; + return s; } TF_RET_CHECK(response.output().handle() != 0); |