aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_computation.h
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-11-01 19:11:49 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-11-01 19:15:17 -0700
commit53a4fcbdbad571e659203733f6a07ba82651d40b (patch)
tree58f22f4b697ff81126be3f49baf65b841f35762b /tensorflow/compiler/xla/service/hlo_computation.h
parent67fe8d146a0aa642a29a52a1389000b99b19cc03 (diff)
Fixed HloComputation/HloInstruction clone to allow deep clone, and avoid the cloned instruction and computations to still have live link to their parent original modules and computations.
PiperOrigin-RevId: 174271432
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_computation.h')
-rw-r--r--tensorflow/compiler/xla/service/hlo_computation.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_computation.h b/tensorflow/compiler/xla/service/hlo_computation.h
index b44a9e417a..fbbbc45c26 100644
--- a/tensorflow/compiler/xla/service/hlo_computation.h
+++ b/tensorflow/compiler/xla/service/hlo_computation.h
@@ -289,7 +289,11 @@ class HloComputation {
Status Accept(const FunctionVisitor::VisitorFunction& visitor_func) const;
// Returns a deep copy of this computation including all instructions.
- std::unique_ptr<HloComputation> Clone(const string& suffix = "clone");
+ // If the module pointer is not nullptr, it will be the module where
+ // the cloned computations will be added to (in order to support deep
+ // cloning).
+ std::unique_ptr<HloComputation> Clone(const string& suffix = "clone",
+ HloModule* module = nullptr);
// Returns true if the given instruction can be removed from the
// computation. Instructions such as parameters and send/receive instructions