Skip to content

Commit

Permalink
Dont fold constant string.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 159497483
  • Loading branch information
benoitsteiner authored and tensorflower-gardener committed Jun 19, 2017
1 parent ac47dc1 commit f9a6477
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tensorflow/core/grappler/optimizers/constant_folding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,16 @@ bool ConstantFolding::IsFoldable(const NodeDef& node) const {
if (IsControlInput(input)) {
continue;
}
bool is_const = IsConstant(*node_map_->GetNode(input));
const NodeDef* input_node = node_map_->GetNode(input);
bool is_const = IsConstant(*input_node);
if (!is_const && !is_merge) {
return false;
}
// Don't fold strings constants for now since this causes problems with
// checkpointing.
if (is_const && input_node->attr().at("dtype").type() == DT_STRING) {
return false;
}
has_constant_input |= is_const;
}
if (is_merge) {
Expand Down

0 comments on commit f9a6477

Please sign in to comment.