[MachineLearning.Inference] Fix the bug for double type of GetValue<T> (#1995)
authorSangjung Woo <sangjung.woo@samsung.com>
Tue, 8 Sep 2020 11:50:17 +0000 (20:50 +0900)
committerGitHub <noreply@github.com>
Tue, 8 Sep 2020 11:50:17 +0000 (20:50 +0900)
This patch fixes the bug for double type of GetValue<T> method.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
src/Tizen.MachineLearning.Inference/Tizen.MachineLearning.Inference/Pipeline.cs

index ea9e8f9..d6abcae 100755 (executable)
@@ -868,6 +868,13 @@ namespace Tizen.MachineLearning.Inference
 
                     return (T)Convert.ChangeType(value, typeof(T));
                 }
+                else if (typeof(double).IsAssignableFrom(typeof(T)))
+                {
+                    ret = Interop.Pipeline.GetPropertyDouble(Handle, propertyName, out double value);
+                    NNStreamer.CheckException(ret, string.Format("Failed to get {0} property.", propertyName));
+
+                    return (T)Convert.ChangeType(value, typeof(T));
+                }
 
                 throw new ArgumentException("The Input data type is not valid.");
             }