2021-11-13 00:56:31 +00:00
|
|
|
#include "lib/Api.Experimental/pch/pch.h"
|
|
|
|
|
#include "LearningModelJoinOptions.h"
|
|
|
|
|
|
|
|
|
|
namespace WINML_EXPERIMENTALP {
|
|
|
|
|
|
2023-07-26 04:56:50 +00:00
|
|
|
LearningModelJoinOptions::LearningModelJoinOptions() {
|
2021-11-13 00:56:31 +00:00
|
|
|
GUID guid;
|
2022-11-28 17:16:22 +00:00
|
|
|
WINML_THROW_IF_FAILED(CoCreateGuid(&guid));
|
2021-11-13 00:56:31 +00:00
|
|
|
|
|
|
|
|
OLECHAR* guidString;
|
2022-11-28 17:16:22 +00:00
|
|
|
WINML_THROW_IF_FAILED(StringFromCLSID(guid, &guidString));
|
2021-11-13 00:56:31 +00:00
|
|
|
|
|
|
|
|
join_prefix_ = winrt::to_string(winrt::hstring(guidString));
|
|
|
|
|
// ensure memory is freed
|
|
|
|
|
::CoTaskMemFree(guidString);
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-26 04:56:50 +00:00
|
|
|
bool LearningModelJoinOptions::PromoteUnlinkedOutputsToFusedOutputs() {
|
|
|
|
|
return promote_unlinked_outputs_;
|
2021-11-13 00:56:31 +00:00
|
|
|
}
|
2023-07-26 04:56:50 +00:00
|
|
|
void LearningModelJoinOptions::PromoteUnlinkedOutputsToFusedOutputs(bool value) {
|
|
|
|
|
promote_unlinked_outputs_ = value;
|
2021-11-13 00:56:31 +00:00
|
|
|
}
|
2023-07-26 04:56:50 +00:00
|
|
|
winrt::hstring LearningModelJoinOptions::JoinedNodePrefix() {
|
2021-11-13 00:56:31 +00:00
|
|
|
return winrt::to_hstring(join_prefix_);
|
|
|
|
|
}
|
2023-07-26 04:56:50 +00:00
|
|
|
void LearningModelJoinOptions::JoinedNodePrefix(hstring const& join_prefix) {
|
2021-11-13 00:56:31 +00:00
|
|
|
join_prefix_ = winrt::to_string(join_prefix);
|
|
|
|
|
}
|
2023-07-26 04:56:50 +00:00
|
|
|
bool LearningModelJoinOptions::CloseModelOnJoin() {
|
|
|
|
|
return close_model_on_link_;
|
2021-11-13 00:56:31 +00:00
|
|
|
}
|
2023-07-26 04:56:50 +00:00
|
|
|
void LearningModelJoinOptions::CloseModelOnJoin(bool value) {
|
|
|
|
|
close_model_on_link_ = value;
|
2021-11-13 00:56:31 +00:00
|
|
|
}
|
2023-07-26 04:56:50 +00:00
|
|
|
void LearningModelJoinOptions::Link(hstring const& firstModelOutput, hstring const& secondModelInput) {
|
|
|
|
|
linkages_[winrt::to_string(firstModelOutput)] = winrt::to_string(secondModelInput);
|
2021-11-13 00:56:31 +00:00
|
|
|
}
|
|
|
|
|
const std::unordered_map<std::string, std::string>& LearningModelJoinOptions::GetLinkages() {
|
2023-07-26 04:56:50 +00:00
|
|
|
return linkages_;
|
2021-11-13 00:56:31 +00:00
|
|
|
}
|
|
|
|
|
|
2023-08-15 03:50:14 +00:00
|
|
|
} // namespace WINML_EXPERIMENTALP
|