aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Skye Wanderman-Milne <skyewm@google.com>2018-04-03 17:57:08 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-04-03 18:01:18 -0700
commit6d05c781d71b09f10246b2d15039e1b1df899f62 (patch)
tree85b53f716af866d7dc4cbd1c4c45ca3d137d2075
parentf5f7fdb28dd798c6e6b39ab5e55fd33a63ae8733 (diff)
Fix bug where name generated by Graph::NewName can conflict with generated Send node name.
I fixed this very locally to avoid having to fix a bunch of tests (this is currently blocking enabling the C API), but this should be fixed more generally in the future. PiperOrigin-RevId: 191528409
-rw-r--r--tensorflow/core/graph/quantize_training.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/tensorflow/core/graph/quantize_training.cc b/tensorflow/core/graph/quantize_training.cc
index cb0fc8a154..3b6e8cc233 100644
--- a/tensorflow/core/graph/quantize_training.cc
+++ b/tensorflow/core/graph/quantize_training.cc
@@ -259,8 +259,14 @@ Status AddRestoreVariableSubgraphs(Graph* graph, Node* save_op,
const string restore_op_name = strings::StrCat(name_prefix, "/RestoreV2");
const string assign_op_name = strings::StrCat(name_prefix, "/Assign");
for (Node* var : variables) {
- string new_restore_op_name = graph->NewName(restore_op_name);
- string new_assign_op_name = graph->NewName(assign_op_name);
+ // Add an extra prefix after calling graph->NewName because the "unique"
+ // name may conflict with names generated for Send nodes.
+ // TODO(b/77547936): fix this more generally and get rid of the extra prefix
+ // here.
+ string new_restore_op_name =
+ strings::StrCat(graph->NewName(restore_op_name), "_qt");
+ string new_assign_op_name =
+ strings::StrCat(graph->NewName(assign_op_name), "_qt");
string tensor_names_op_name =
strings::StrCat(new_restore_op_name, "/tensor_names");
string shape_and_slices_op_name =