diff --git a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/GraphPartitioner.cpp b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/GraphPartitioner.cpp index 594f821aafb90..0862b07d6b226 100644 --- a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/GraphPartitioner.cpp +++ b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/GraphPartitioner.cpp @@ -105,7 +105,7 @@ namespace Dml for (GraphPartition* partitionToMerge : partitionsToMerge) { - if (partitionToMerge == this) + if (partitionToMerge->GetRootMergedPartition() == this) { continue; }