onnxruntime/winml/lib/Api.Experimental/LearningModelOutputs.cpp
Ginés Hidalgo 79436a2d5b
Avoided warning C5038 (#9543)
Updated several DML EP files to avoid warning C5038: data member 'member1' will be initialized after data member 'member2' / base class 'base_class'

More information:
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5038?view=msvc-160
2021-10-30 00:36:22 -07:00

25 lines
956 B
C++

#include "lib/Api.Experimental/pch/pch.h"
#include "LearningModelOutputs.h"
#include "LearningModelBuilder.h"
#include "TensorFeatureDescriptor.h"
namespace WINML_EXPERIMENTALP
{
LearningModelOutputs::LearningModelOutputs(winml_experimental::LearningModelBuilder builder) :
output_descriptors_(winrt::single_threaded_vector<winml::ILearningModelFeatureDescriptor>()),
builder_(builder) {
}
winml_experimental::LearningModelBuilder LearningModelOutputs::Add(winml::ILearningModelFeatureDescriptor const& output)
{
// Perform model update inside the builder
auto model = builder_.as<winml_experimentalp::LearningModelBuilder>()->UseModel();
auto descriptor_provider = output.as<_winml::IDescriptorInfoProvider>();
auto name = _winml::Strings::UTF8FromHString(output.Name());
model->AddModelOutput(name.c_str(), descriptor_provider.get());
output_descriptors_.Append(output);
return builder_;
}
} // namespace WINML_EXPERIMENTALP