diff options
Diffstat (limited to 'tensorflow/core/framework/function.h')
-rw-r--r-- | tensorflow/core/framework/function.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tensorflow/core/framework/function.h b/tensorflow/core/framework/function.h index 8e607b927c..5da9af7db3 100644 --- a/tensorflow/core/framework/function.h +++ b/tensorflow/core/framework/function.h @@ -261,7 +261,10 @@ class FunctionCallFrame : public CallFrameInterface { // Caller methods. Status SetArgs(gtl::ArraySlice<Tensor> args); Status GetRetvals(std::vector<Tensor>* rets) const; - Status ConsumeRetvals(std::vector<Tensor>* rets); + + // Moves the return values from the frame to rets. If allow_dead_tensors is + // false it will fail if any of the retvals do not have a value. + Status ConsumeRetvals(std::vector<Tensor>* rets, bool allow_dead_tensors); size_t num_args() const override { return arg_types_.size(); } size_t num_retvals() const override { return ret_types_.size(); } @@ -510,6 +513,9 @@ class FunctionLibraryRuntime { // If true, we create a new IntraProcessRendezvous, else use the existing // one. bool create_rendezvous = false; + + // If True, allow returning dead tensors. + bool allow_dead_tensors = false; }; typedef std::function<void(const Status&)> DoneCallback; virtual void Run(const Options& opts, Handle handle, |