diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-02-16 13:31:04 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-02-16 13:34:47 -0800 |
commit | 1bde8c61e14b1c42db20a1b07684ea2534cfdf01 (patch) | |
tree | 96b49f2ed4f6dc5054c3fa47707dd295ae670dd6 /tensorflow/compiler/xla/service/hlo_computation.h | |
parent | 6e5ca37827d95b12c4712cf237ec2f8124ed885c (diff) |
Automated g4 rollback of changelist 185623948
PiperOrigin-RevId: 186038783
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_computation.h')
-rw-r--r-- | tensorflow/compiler/xla/service/hlo_computation.h | 8 |
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_; |