2021-08-23 18:19:03 +00:00
|
|
|
#include "lib/Api.Experimental/pch/pch.h"
|
2021-01-22 23:15:53 +00:00
|
|
|
#include "LearningModelSessionOptionsExperimental.h"
|
|
|
|
|
#include "winrt/Windows.Foundation.Collections.h"
|
|
|
|
|
#include "LearningModelSession.h"
|
2023-07-01 05:17:35 +00:00
|
|
|
#include "LearningModelSessionOptions.h"
|
2021-01-22 23:15:53 +00:00
|
|
|
#include "iengine.h"
|
|
|
|
|
|
|
|
|
|
namespace WINML_EXPERIMENTALP {
|
2023-07-26 04:56:50 +00:00
|
|
|
LearningModelSessionOptionsExperimental::LearningModelSessionOptionsExperimental(
|
|
|
|
|
const winml::LearningModelSessionOptions& options
|
|
|
|
|
)
|
|
|
|
|
: options_(options) {
|
|
|
|
|
}
|
2023-07-01 05:17:35 +00:00
|
|
|
|
2023-07-26 04:56:50 +00:00
|
|
|
LearningModelSessionOptionsExperimental::LearningModelSessionOptionsExperimental(
|
|
|
|
|
const winml::LearningModelSession& session
|
|
|
|
|
)
|
|
|
|
|
: options_(nullptr) {
|
2021-01-22 23:15:53 +00:00
|
|
|
com_ptr<WINMLP::LearningModelSession> session_impl = session.as<WINMLP::LearningModelSession>();
|
2023-07-01 05:17:35 +00:00
|
|
|
options_ = session_impl->Options();
|
|
|
|
|
|
2023-07-26 04:56:50 +00:00
|
|
|
_winml::IEngine* engine = session_impl->GetEngine();
|
2021-01-22 23:15:53 +00:00
|
|
|
engine->GetNamedDimensionOverrides(overrides_);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
wfc::IMapView<winrt::hstring, uint32_t> LearningModelSessionOptionsExperimental::GetNamedDimensionOverrides() {
|
2021-04-13 00:51:25 +00:00
|
|
|
telemetry_helper.LogApiUsage("LearningModelSessionOptionsExperimental::GetNamedDimensionOverrides");
|
2021-01-22 23:15:53 +00:00
|
|
|
return overrides_;
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-01 05:17:35 +00:00
|
|
|
void LearningModelSessionOptionsExperimental::RegisterCustomOpsLibrary(const hstring& path) {
|
|
|
|
|
telemetry_helper.LogApiUsage("LearningModelSessionOptionsExperimental::RegisterCustomOpsLibrary");
|
|
|
|
|
com_ptr<WINMLP::LearningModelSessionOptions> options_impl = options_.as<WINMLP::LearningModelSessionOptions>();
|
|
|
|
|
options_impl->RegisterCustomOpsLibrary(path);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace WINML_EXPERIMENTALP
|