From 70523a3df53f5fe37ac1dd1252fe47a0681d0d45 Mon Sep 17 00:00:00 2001 From: Ryan Lai Date: Wed, 15 Jan 2020 17:07:22 -0800 Subject: [PATCH] Fix warnings that cause build to fail --- .../core/providers/dml/OperatorAuthorHelper/OperatorHelper.h | 5 +++-- winml/test/common/protobufHelpers.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/onnxruntime/core/providers/dml/OperatorAuthorHelper/OperatorHelper.h b/onnxruntime/core/providers/dml/OperatorAuthorHelper/OperatorHelper.h index aeec2deeec..c944c1b59b 100644 --- a/onnxruntime/core/providers/dml/OperatorAuthorHelper/OperatorHelper.h +++ b/onnxruntime/core/providers/dml/OperatorAuthorHelper/OperatorHelper.h @@ -437,6 +437,7 @@ public: template GemmHelper(const Info_t& info, const Shape_t& shape) { + ORT_UNUSED_PARAMETER(shape); m_transA = info.GetOptionalAttribute(AttrName::TransA, 0); m_transB = info.GetOptionalAttribute(AttrName::TransB, 0); m_broadcast = info.GetOptionalAttribute(AttrName::Broadcast, 0); @@ -528,7 +529,7 @@ public: ends.push_back(gsl::narrow_cast(endsData[i])); } uint32_t inputCount = operatorInfo.GetInputCount(); - if (operatorInfo.GetInputCount() > 3) + if (inputCount > 3) { MLOperatorTensor axesTensor = operatorInfo.GetConstantInputTensor(3); const std::vector& axesTensorDimensions = axesTensor.GetShape(); @@ -540,7 +541,7 @@ public: } } - if (operatorInfo.GetInputCount() > 4) + if (inputCount > 4) { MLOperatorTensor stepsTensor = operatorInfo.GetConstantInputTensor(4); const std::vector& stepsTensorDimensions = stepsTensor.GetShape(); diff --git a/winml/test/common/protobufHelpers.cpp b/winml/test/common/protobufHelpers.cpp index 0f3c22fb1c..dbd440b9ab 100644 --- a/winml/test/common/protobufHelpers.cpp +++ b/winml/test/common/protobufHelpers.cpp @@ -323,9 +323,9 @@ winrt::Windows::AI::MachineLearning::LearningModel ProtobufHelpers::CreateModel( DataWriter m_dataWriter; }; - auto size = model.ByteSize(); + auto size = model.ByteSizeLong(); auto raw_array = std::unique_ptr(new char[size]); - model.SerializeToArray(raw_array.get(), size); + model.SerializeToArray(raw_array.get(), static_cast(size)); BufferStreamAdapter buffer; std::ostream os(&buffer);