[XLA] Redesign: add XlaComputation::IsNull.
authorA. Unique TensorFlower <gardener@tensorflow.org>
Thu, 12 Apr 2018 19:12:16 +0000 (12:12 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Thu, 12 Apr 2018 19:14:49 +0000 (12:14 -0700)
PiperOrigin-RevId: 192649052

tensorflow/compiler/xla/client/xla_client/xla_computation.h

index 2a3c695..7182908 100644 (file)
@@ -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_; }