Fix warnings that cause build to fail

This commit is contained in:
Ryan Lai 2020-01-15 17:07:22 -08:00
parent 0b1b40077f
commit 70523a3df5
2 changed files with 5 additions and 4 deletions

View file

@ -437,6 +437,7 @@ public:
template<typename Info_t, typename Shape_t>
GemmHelper(const Info_t& info, const Shape_t& shape)
{
ORT_UNUSED_PARAMETER(shape);
m_transA = info.GetOptionalAttribute<int>(AttrName::TransA, 0);
m_transB = info.GetOptionalAttribute<int>(AttrName::TransB, 0);
m_broadcast = info.GetOptionalAttribute<int>(AttrName::Broadcast, 0);
@ -528,7 +529,7 @@ public:
ends.push_back(gsl::narrow_cast<int32_t>(endsData[i]));
}
uint32_t inputCount = operatorInfo.GetInputCount();
if (operatorInfo.GetInputCount() > 3)
if (inputCount > 3)
{
MLOperatorTensor axesTensor = operatorInfo.GetConstantInputTensor(3);
const std::vector<uint32_t>& axesTensorDimensions = axesTensor.GetShape();
@ -540,7 +541,7 @@ public:
}
}
if (operatorInfo.GetInputCount() > 4)
if (inputCount > 4)
{
MLOperatorTensor stepsTensor = operatorInfo.GetConstantInputTensor(4);
const std::vector<uint32_t>& stepsTensorDimensions = stepsTensor.GetShape();

View file

@ -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<char[]>(new char[size]);
model.SerializeToArray(raw_array.get(), size);
model.SerializeToArray(raw_array.get(), static_cast<int>(size));
BufferStreamAdapter buffer;
std::ostream os(&buffer);