aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/graph/graph_partition.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-07-26 21:53:47 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-07-26 21:57:20 -0700
commita52470172324e77dff9f548cb40e45d6a3a156b5 (patch)
treee273c480fe6861bd4af5fe0cd0d3e7f856039e90 /tensorflow/core/graph/graph_partition.cc
parenta49fe0366880ec51f452bf3106d342bb586d5e93 (diff)
Sets the incarnation number even when the attribute is set.
PiperOrigin-RevId: 163299121
Diffstat (limited to 'tensorflow/core/graph/graph_partition.cc')
-rw-r--r--tensorflow/core/graph/graph_partition.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/tensorflow/core/graph/graph_partition.cc b/tensorflow/core/graph/graph_partition.cc
index 750e18a9ca..bf8dcb2fcf 100644
--- a/tensorflow/core/graph/graph_partition.cc
+++ b/tensorflow/core/graph/graph_partition.cc
@@ -909,8 +909,13 @@ void SetIncarnation(const PartitionOptions& opts, NodeDef* ndef) {
// No known send_device. The runtime will detect it later.
return;
}
- int64 incarnation = opts.get_incarnation(send_device);
- AddNodeAttr("send_device_incarnation", incarnation, ndef);
+ int64 incarnation = PartitionOptions::kIllegalIncarnation;
+ if (!GetNodeAttr(*ndef, "send_device_incarnation", &incarnation).ok() ||
+ (incarnation == PartitionOptions::kIllegalIncarnation)) {
+ incarnation = opts.get_incarnation(send_device);
+ SetAttrValue(incarnation,
+ &((*ndef->mutable_attr())["send_device_incarnation"]));
+ }
}
// Sets attribute send_device_incarnation of all Send/Recv nodes in