From ecacd206c44811baa75bef07b2ce99cd1021163c Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Thu, 12 Apr 2018 12:12:16 -0700 Subject: [PATCH] [XLA] Redesign: add XlaComputation::IsNull. PiperOrigin-RevId: 192649052 --- tensorflow/compiler/xla/client/xla_client/xla_computation.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tensorflow/compiler/xla/client/xla_client/xla_computation.h b/tensorflow/compiler/xla/client/xla_client/xla_computation.h index 2a3c695..7182908 100644 --- a/tensorflow/compiler/xla/client/xla_client/xla_computation.h +++ b/tensorflow/compiler/xla/client/xla_client/xla_computation.h @@ -44,6 +44,9 @@ class XlaComputation { const HloModuleProto& proto() const { return proto_; } + // Returns true if this object is a null Computation. + bool IsNull() const { return unique_id_ == -1; } + private: XlaComputation(const int64 unique_id) : unique_id_(unique_id) {} HloModuleProto* mutable_proto() { return &proto_; } -- 2.7.4