Skip to content

Commit

Permalink
Assign variant_tensor_name by value in AddDeserializationOpsForParame…
Browse files Browse the repository at this point in the history
…ters.

The reference is invalidated by the line:
binding.mutable_sequence()->Clear()
so its use on the subsequent line causes errors. Making variant_tensor_name not a reference fixes this.

PiperOrigin-RevId: 402698870
  • Loading branch information
Maxwell Collins authored and tensorflow-copybara committed Oct 13, 2021
1 parent 9c3e888 commit a94edb7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ absl::Status AddDeserializationOpsForParameters(
case v0::TensorFlow::Binding::kSequence: {
// Get the name of the placeholder we're operating on and create a name
// for the new deserialization op.
const std::string& variant_tensor_name =
const std::string variant_tensor_name =
binding.sequence().variant_tensor_name();
auto graph_names = GetVariantTensorNodeNameAndReplacement(
variant_tensor_name, kDatasetFromGraphOp, prefix);
Expand Down

0 comments on commit a94edb7

Please sign in to comment.