From 923cac17cb09e679af7f186c26873181ee89666d Mon Sep 17 00:00:00 2001 From: Jeff Bloomfield Date: Tue, 2 Jan 2024 14:57:30 -0800 Subject: [PATCH] Add comment --- .../providers/dml/DmlExecutionProvider/src/GraphDescBuilder.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/GraphDescBuilder.cpp b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/GraphDescBuilder.cpp index 3ae5f6d28e2f5..adb4fd131119f 100644 --- a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/GraphDescBuilder.cpp +++ b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/GraphDescBuilder.cpp @@ -357,6 +357,8 @@ namespace Dml::GraphDescBuilder if (constantInput && tensorDesc->totalTensorSizeInBytes < c_maxConstNodeDataSize) { + // The tensor description's size should be no larger than the constant input unless it was rounded to + // the required alignment. assert(((constantInput->GetTensorByteSize() + 3) & ~3) >= tensorDesc->totalTensorSizeInBytes); size_t minimumConstantSize = std::min(constantInput->GetTensorByteSize(), tensorDesc->totalTensorSizeInBytes); auto data = static_cast(constantInput->GetData());