-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Experimental API for setting model name #10518
Conversation
@@ -66,6 +66,9 @@ IModelInfo : IUnknown { | |||
STDMETHOD(GetName) | |||
(const char** out, size_t* len) PURE; | |||
|
|||
STDMETHOD(SetName) | |||
(const char* name) PURE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the convention that we expect the char* to be null terminated and therefore we don't need to pass the length?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I assume the char* will be null terminated
ORT_API_STATUS_IMPL(winmla::ModelSetName, _In_ const OrtModel* model, _In_ const char* const name) { | ||
API_IMPL_BEGIN | ||
auto model_proto = model->UseModelProto(); | ||
ONNX_NAMESPACE::GraphProto& graph = *model_proto->mutable_graph(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can the "mutable_graph()" call return null?
@@ -279,6 +279,13 @@ LearningModel::OutputFeatures() try { | |||
} | |||
WINML_CATCH_ALL | |||
|
|||
void LearningModel::SetName(const hstring& name) try { | |||
auto name_std_str = _winml::Strings::UTF8FromHString(name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this return when you pass in something that can't be represented in char*? like a wide-unicode character
This change adds the SetName function to the LearningModelExperimental API