diff options
author | Michael Kuperstein <mkuper@google.com> | 2018-09-17 12:23:18 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-09-17 12:29:52 -0700 |
commit | 3fe7b38347eaf7f1fb764cc2ac92de0ce7bc51e5 (patch) | |
tree | 7d3f4ff7567a8fb496e3994cab94db6dfb7a77b3 /tensorflow/compiler/xla/service/hlo_computation.h | |
parent | 0d9868d8f9c01c1402ae99d672599c4bac6e787d (diff) |
[XLA] Allow adding extra instructions in HloComputation::CloneWithReplacements
PiperOrigin-RevId: 213316504
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_computation.h')
-rw-r--r-- | tensorflow/compiler/xla/service/hlo_computation.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_computation.h b/tensorflow/compiler/xla/service/hlo_computation.h index a880e9ab30..e7c98aae23 100644 --- a/tensorflow/compiler/xla/service/hlo_computation.h +++ b/tensorflow/compiler/xla/service/hlo_computation.h @@ -333,10 +333,13 @@ class HloComputation { // // If replacements maps a key to nullptr, we remove that instruction from the // new computation. + // If additional instructions are used by instructions in replacement map, + // they must be passed in post-order in the extras span. std::unique_ptr<HloComputation> CloneWithReplacements( std::unordered_map<const HloInstruction*, std::unique_ptr<HloInstruction>> replacements, - HloCloneContext* context = nullptr, const string& suffix = "clone"); + absl::Span<HloInstruction*> extras, HloCloneContext* context = nullptr, + const string& suffix = "clone"); // Returns true if the given instruction can be removed from the computation. // Parameter instructions cannot be removed without violating invariants of |