-
Notifications
You must be signed in to change notification settings - Fork 254
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
[MachineLearning.Inference] Add MlInformation and MlInformationList #6519
base: main
Are you sure you want to change the base?
Conversation
Public API ChangedPlease follow the ACR process for the changed API below. Added: 16, Removed: 0, Changed: 0Added+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.MlInformation
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Int32 Tizen.MachineLearning.Inference.MlInformation::GetNumber(System.String)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.String Tizen.MachineLearning.Inference.MlInformation::GetString(System.String)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::.ctor()
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::Dispose()
+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::Dispose(System.Boolean)
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::Finalize()
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::SetNumber(System.String,System.Int32)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::SetString(System.String,System.String)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.TensorsData Tizen.MachineLearning.Inference.MlInformation::GetTensorsData(System.String)
+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.MlInformationList
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Int32 Tizen.MachineLearning.Inference.MlInformationList::GetLength()
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformationList::Dispose()
+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformationList::Dispose(System.Boolean)
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformationList::Finalize()
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.MlInformation Tizen.MachineLearning.Inference.MlInformationList::GetInformation(System.Int32)
|
/// Gets a int value of key in MlInformation instance. | ||
/// </summary> | ||
/// <param name="key">The key to be set.</param> | ||
/// <returns>The string value of the key.</returns> |
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.
suggestion:
description: The integer value of the key.
method name: GetNumber/SetNumber -> GetInteger / SetInteger ?
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.
Updated description and method name :)
} | ||
|
||
/// <summary> | ||
/// Gets a int value of key in MlInformation instance. |
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.
Typo: Gets an int value
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.
Updated 👍
/// <summary> | ||
/// Gets a string value of key in MlInformation instance. | ||
/// </summary> | ||
/// <param name="key">The key to be set.</param> |
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.
231 and 248
The key to get the corresponding value.
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.
Updated 👍
} | ||
|
||
/// <summary> | ||
/// Creates a MlInformation instance from Native handle. |
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.
Typo: from Native handle -> from native handle
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.
Updated 👍
break; | ||
case InfoType.Information: | ||
ret = NNStreamerError.NotSupported; | ||
Log.Error(NNStreamer.TAG, "InfoType Iniformation does not support set value"); |
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.
Typo: Iniformation -> Information
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.
Updated 👍
break; | ||
} | ||
|
||
NNStreamer.CheckException(ret, "Failed to set string value"); |
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.
typo: set string value -> set integer value
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.
Fixed it :)
4bb38a7
to
644f08b
Compare
Public API ChangedPlease follow the ACR process for the changed API below. Added: 16, Removed: 0, Changed: 0Added+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.MlInformation
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Int32 Tizen.MachineLearning.Inference.MlInformation::GetInteger(System.String)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.String Tizen.MachineLearning.Inference.MlInformation::GetString(System.String)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::.ctor()
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::Dispose()
+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::Dispose(System.Boolean)
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::Finalize()
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::SetInteger(System.String,System.Int32)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::SetString(System.String,System.String)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.TensorsData Tizen.MachineLearning.Inference.MlInformation::GetTensorsData(System.String)
+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.MlInformationList
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Int32 Tizen.MachineLearning.Inference.MlInformationList::GetLength()
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformationList::Dispose()
+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformationList::Dispose(System.Boolean)
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformationList::Finalize()
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.MlInformation Tizen.MachineLearning.Inference.MlInformationList::GetInformation(System.Int32)
|
NNStreamer.CheckException(ret, "Failed to set integer value"); | ||
} | ||
|
||
private IntPtr GetInformationHandle(string key) |
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.
Suggestion:
method name GetInformationHandle > GetValue
line 223, 240, 257, 276
error message "information handle from key" > "value of key from information handle"
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.
Changed method name and updated error message :)
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.
@again4you
After reviewing with Sangjung, let's start ACR :)
/// <feature>http://tizen.org/feature/machine_learning.inference</feature> | ||
/// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception> | ||
/// <since_tizen> 13 </since_tizen> | ||
public string GetString(string key) |
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.
line 236, 253, 270 add exception 'not-supported' (GetInformationHandle() may raise an exception for this.)
/// <exception cref="NotSupportedException">Thrown when the feature is not supported.</exception>
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.
Added not-supported
exception 👍
/// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. | ||
/// </summary> | ||
/// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param> | ||
protected virtual void Dispose(bool disposing) |
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 /// <since_tizen> 13 </since_tizen>
necessary?
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.
IMO, unnecessary.
644f08b
to
3266233
Compare
Public API ChangedPlease follow the ACR process for the changed API below. Added: 16, Removed: 0, Changed: 0Added+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.MlInformation
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Int32 Tizen.MachineLearning.Inference.MlInformation::GetInteger(System.String)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.String Tizen.MachineLearning.Inference.MlInformation::GetString(System.String)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::.ctor()
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::Dispose()
+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::Dispose(System.Boolean)
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::Finalize()
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::SetInteger(System.String,System.Int32)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::SetString(System.String,System.String)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.TensorsData Tizen.MachineLearning.Inference.MlInformation::GetTensorsData(System.String)
+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.MlInformationList
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Int32 Tizen.MachineLearning.Inference.MlInformationList::GetLength()
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformationList::Dispose()
+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformationList::Dispose(System.Boolean)
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformationList::Finalize()
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.MlInformation Tizen.MachineLearning.Inference.MlInformationList::GetInformation(System.Int32)
|
3266233
to
6eee932
Compare
Public API ChangedPlease follow the ACR process for the changed API below. Added: 16, Removed: 0, Changed: 0Added+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.MlInformation
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Int32 Tizen.MachineLearning.Inference.MlInformation::GetInteger(System.String)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.String Tizen.MachineLearning.Inference.MlInformation::GetString(System.String)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::.ctor()
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::Dispose()
+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::Dispose(System.Boolean)
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::Finalize()
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::SetInteger(System.String,System.Int32)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::SetString(System.String,System.String)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.TensorsData Tizen.MachineLearning.Inference.MlInformation::GetTensorsData(System.String)
+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.MlInformationList
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Int32 Tizen.MachineLearning.Inference.MlInformationList::GetLength()
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformationList::Dispose()
+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformationList::Dispose(System.Boolean)
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformationList::Finalize()
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.MlInformation Tizen.MachineLearning.Inference.MlInformationList::GetInformation(System.Int32)
|
/// </summary> | ||
/// <param name="key">The key to be set.</param> | ||
/// <param name="value">The value to be set.</param> | ||
/// <feature>http://tizen.org/feature/machine_learning.inference</feature> |
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.
In the case of ml_inofrmation_*, it will be used in ml-service (and training?) later.
How about implementing these as a common part?
Tizen.MachineLearning or Tizen.MachineLearning.Common feature
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.
Tizen.MachineLearning.Inference must be included to use MlInformation.GetTensorsData
.
So how about using Tizen.MachineLearning.Inference namespace like any other common part so that user don't have to declare multiple namespaces?
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.
Okay, let's use the Tizen.MachineLearning.Inference namespace now. Consider separating them to common parts when it becomes necessary later.
/// Creates a MlInformationList instance. | ||
/// </summary> | ||
/// <feature>http://tizen.org/feature/machine_learning.inference</feature> | ||
/// <exception cref="NotSupportedException">Thrown when the feature is not supported.</exception> |
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.
Please check the exception here and below.
I think in this case ArgumentException
.
/// <exception cref="NotSupportedException">Thrown when the feature is not supported.</exception> | |
/// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception> |
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.
Added ArgumentException
Thank you :)
This patch newly adds the MlInformation and MlInformationList class. These class manages information based on key-value. Added: - MlInformation - MlInformationList Signed-off-by: Yelin Jeong <[email protected]>
6eee932
to
679f597
Compare
Public API ChangedPlease follow the ACR process for the changed API below. Added: 16, Removed: 0, Changed: 0Added+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.MlInformation
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Int32 Tizen.MachineLearning.Inference.MlInformation::GetInteger(System.String)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.String Tizen.MachineLearning.Inference.MlInformation::GetString(System.String)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::.ctor()
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::Dispose()
+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::Dispose(System.Boolean)
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::Finalize()
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::SetInteger(System.String,System.Int32)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformation::SetString(System.String,System.String)
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.TensorsData Tizen.MachineLearning.Inference.MlInformation::GetTensorsData(System.String)
+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.MlInformationList
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ System.Int32 Tizen.MachineLearning.Inference.MlInformationList::GetLength()
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformationList::Dispose()
+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformationList::Dispose(System.Boolean)
+ /// <since_tizen>13</since_tizen
+ System.Void Tizen.MachineLearning.Inference.MlInformationList::Finalize()
+ /// <privilege>http://tizen.org/feature/machine_learning.inference</privilege
+ /// <since_tizen>13</since_tizen
+ Tizen.MachineLearning.Inference.MlInformation Tizen.MachineLearning.Inference.MlInformationList::GetInformation(System.Int32)
|
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.
LGTM
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.
Ready to go! Good Job!
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.
LGTM
This patch newly adds the MlInformation and MlInformationList class. These class manages information based on key-value.
Description of Change
Added:
API Changes