Small addendum to #9624 (#9639)

This commit is contained in:
Hariharan Seshadri 2021-11-01 15:54:21 -07:00 committed by GitHub
parent 1240c595a9
commit f41396eff0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -688,6 +688,19 @@ void SessionState::ResolveMemoryPatternFlag() {
break;
}
}
// For subgraphs, the implicit inputs need to meet the same crieria
// as the explicit inputs for memory pattern to be enabled
if (graph_viewer_->IsSubgraph()) {
const auto* parent_node = graph_viewer_->ParentNode();
for (auto* implicit_input : parent_node->ImplicitInputDefs()) {
if (!implicit_input->HasTensorOrScalarShape()) {
enable_mem_pattern_ = false;
break;
}
}
}
}
}