onnxruntime/winml/lib/Api.Experimental/LearningModelOutputs.cpp
Justin Chu 416dc2e84d
Fix clang-format comment indents on Windows for winml/ (#17144)
On Windows, clang-format has a bug when AlignTrailingComments.Kind is
set to `Leave`
(https://clang.llvm.org/docs/ClangFormatStyleOptions.html#aligntrailingcomments),
where it will keep adding indentation to comments after each formatting
runs.

This PR changes to always align comments so we do not hit the bug.

As a consequence of the options change we need to reformat some of the
files. Note that this option is aligned with the rest of the repository.
2023-08-14 23:50:14 -04:00

24 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