onnxruntime/winml/lib/Api.Experimental/LearningModelOutputs.cpp
Tiago Koji Castro Shibata 53e7831b53
Fix Windows Store build (#8481)
* Remove APIs unavailable in Store in #8349, #8178, #8065

* Add UWP stubs of C runtime functions

* Remove UWP incompatible tests from UWP build

* Remove incompatible tests from Store

* Use UWP stubs in store only

* Skip partition check outside of Windows

* Remove unused WRL include

* Workaround Windows header not including what it uses

* Fix precompiled header name clash

* Workaround SDK bugs

* DXCore workaround in Win7

* Fix warning

* Fix more warnings

* Bump WinML to target Windows 8

* Fix more warnings

* Remove unnecessary workarounds
2021-08-10 15:19:30 -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) :
builder_(builder),
output_descriptors_(winrt::single_threaded_vector<winml::ILearningModelFeatureDescriptor>()) {
}
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