From 39c2d76c4e6c93c05b272cd17c87b07f17f59a7d Mon Sep 17 00:00:00 2001 From: Sumit Agarwal Date: Wed, 29 Sep 2021 03:16:57 +0000 Subject: [PATCH] Merged PR 6512710: Code clean up in DmlOperatorPadding Addressed comments on the [PR:6511109](https://microsoft.visualstudio.com/DefaultCollection/WindowsAI/_git/onnxruntime/pullrequest/6511109) --- .../DmlExecutionProvider/src/Operators/DmlOperatorPadding.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorPadding.cpp b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorPadding.cpp index b785234f32..5dd8767bf7 100644 --- a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorPadding.cpp +++ b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorPadding.cpp @@ -73,14 +73,14 @@ public: // Same applies to paddingValue. paddingDesc.PaddingValueDataType = this->m_inputTensorDescs[0].GetDmlDataType(); CastToScalarUnion(paddingDesc.PaddingValueDataType, 0.0f, /*out*/&paddingDesc.PaddingValue); - + // Read the constant value which can come from an attribute or tensor. if (opsetVersion >= 11) { if (kernelInfo.IsInputValid(2)) { MLOperatorTensor constantPaddingValueTensor = kernelInfo.GetConstantInputTensor(2); - ReadScalarTensorData(kernelInfo.GetConstantInputTensor(2), /*out*/ &paddingDesc.PaddingValue.Bytes, sizeof(paddingDesc.PaddingValue.Bytes)); + ReadScalarTensorData(constantPaddingValueTensor, /*out*/ &paddingDesc.PaddingValue.Bytes, sizeof(paddingDesc.PaddingValue.Bytes)); } } else