diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-11-02 18:32:09 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-11-02 18:36:33 -0700 |
commit | 274e9ed51ea6cc09a0b5fc1cee4756ac0e9aa525 (patch) | |
tree | 35b43ee92bfc1689c3deeec03fa13c61ab5c8b1f /tensorflow/compiler/xla/service/hlo_computation.h | |
parent | fbc5460b0a5c2daa477c68477b9330424054ba25 (diff) |
[TF:XLA] Add a const HLO visitor.
Use it in the HLO cost analysis pass.
PiperOrigin-RevId: 174411043
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_computation.h')
-rw-r--r-- | tensorflow/compiler/xla/service/hlo_computation.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_computation.h b/tensorflow/compiler/xla/service/hlo_computation.h index fbbbc45c26..1ff7004c4c 100644 --- a/tensorflow/compiler/xla/service/hlo_computation.h +++ b/tensorflow/compiler/xla/service/hlo_computation.h @@ -271,7 +271,8 @@ class HloComputation { // via the root. The root instruction of the computation is visited last, and // the visitor's FinishVisit method is called once upon completion (with the // root instruction as the argument). - Status Accept(DfsHloVisitor* visitor) const; + template <typename HloInstructionPtr> + Status Accept(DfsHloVisitorBase<HloInstructionPtr>* visitor) const; // Same as Accept() above, but the order of operand and control predecessor // visitation is determined by the given operand order; if compare(A, B) == @@ -286,7 +287,9 @@ class HloComputation { const std::vector<const HloInstruction*>& order) const; // Same as Accept() above, but the visitor is given as a function. - Status Accept(const FunctionVisitor::VisitorFunction& visitor_func) const; + Status Accept(const std::function<Status(HloInstruction*)>& visitor_func); + Status Accept( + const std::function<Status(const HloInstruction*)>& visitor_func) const; // Returns a deep copy of this computation including all instructions. // If the module pointer is not nullptr, it will be the module where |