[WinML] Fix warnings in OnnxruntimeEngine and OnnxruntimeEngineBuilder (#16679)

Fix [prefast:Warning]: C6101 (in
'_winml::OnnxruntimeEngine::CreateTensorValueFromDefaultAllocator'
Fix [prefast:Warning]: C6101 (in
'_winml::OnnxruntimeEngineBuilder::CreateEngine'

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
This commit is contained in:
Sheil Kumar 2023-07-12 13:09:50 -07:00 committed by GitHub
parent 2449ded20f
commit 0c956bef0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View file

@ -564,6 +564,7 @@ OnnxruntimeEngineFactory* OnnxruntimeEngine::GetEngineFactory() {
}
HRESULT OnnxruntimeEngine::CreateTensorValueFromDefaultAllocator(const int64_t* shape, size_t count, winml::TensorKind kind, _Out_ IValue** out) {
*out = nullptr;
auto ort_api = engine_factory_->UseOrtApi();
OrtAllocator* ort_allocator;

View file

@ -20,6 +20,7 @@ HRESULT OnnxruntimeEngineBuilder::RuntimeClassInitialize(_In_ OnnxruntimeEngineF
}
STDMETHODIMP OnnxruntimeEngineBuilder::CreateEngine(_Outptr_ _winml::IEngine** out) {
*out = nullptr;
auto ort_api = engine_factory_->UseOrtApi();
Microsoft::WRL::ComPtr<IOrtSessionBuilder> onnxruntime_session_builder;