aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_computation.h
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-02-13 15:29:00 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-02-13 15:32:59 -0800
commit9a0403542b3c67119e7097a491a2c5e2602b14c3 (patch)
tree5d9dfbbed2c388d8a0ac8c22fa3d899958c5562e /tensorflow/compiler/xla/service/hlo_computation.h
parentdcfa59b8c32e44bcd16fbd58ce91e7d3f332be36 (diff)
Wire in support for XLA kConditional instruction.
PiperOrigin-RevId: 185598764
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_computation.h')
-rw-r--r--tensorflow/compiler/xla/service/hlo_computation.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_computation.h b/tensorflow/compiler/xla/service/hlo_computation.h
index 061c59abe5..39d864efcb 100644
--- a/tensorflow/compiler/xla/service/hlo_computation.h
+++ b/tensorflow/compiler/xla/service/hlo_computation.h
@@ -77,6 +77,14 @@ class HloComputation {
return last_added_instruction_;
}
+ Status ForEachInstruction(
+ const std::function<Status(const HloInstruction*)>& func) const {
+ for (const auto& instruction : instructions_) {
+ TF_RETURN_IF_ERROR(func(instruction.get()));
+ }
+ return Status::OK();
+ }
+
private:
const string name_;
HloInstruction* last_added_instruction_;