From 5fe85f3f85b19ef4741a466c7a0b7569689e6e07 Mon Sep 17 00:00:00 2001 From: zhaoxinxin Date: Fri, 5 Mar 2021 16:19:43 +0800 Subject: [PATCH] modified: ge/graph/partition/dynamic_shape_partition.cc --- ge/graph/partition/dynamic_shape_partition.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ge/graph/partition/dynamic_shape_partition.cc b/ge/graph/partition/dynamic_shape_partition.cc index 2a60765f..623d7604 100755 --- a/ge/graph/partition/dynamic_shape_partition.cc +++ b/ge/graph/partition/dynamic_shape_partition.cc @@ -57,6 +57,17 @@ static bool IsInExperimentalMode(const ComputeGraphPtr &root_graph) { if (is_singleop) { return false; } + // if input_node in root_graph is dynamic shape, skip dynamic partition + // whole graph as one unknown graph + if (node->GetType() == DATA && node->GetOwnerComputeGraph()->GetParentNode() == nullptr) { + auto op_desc = node->GetOpDesc(); + GE_CHECK_NOTNULL(op_desc); + auto data_output_desc = op_desc->GetOutputDescPtr(0); + GE_CHECK_NOTNULL(data_output_desc); + if (data_output_desc->GetShape().IsUnknownShape()) { + return false; + } + } for (const auto &input_desc : node->GetOpDesc()->GetAllInputsDesc()) { auto type = input_desc.GetDataType();