From: Sangjung Woo Date: Tue, 8 Sep 2020 11:50:17 +0000 (+0900) Subject: [MachineLearning.Inference] Fix the bug for double type of GetValue (#1995) X-Git-Tag: accepted/tizen/unified/20210219.040944~422 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a7746f04880e5a7e61c0d743c4b5bb03191168c5;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [MachineLearning.Inference] Fix the bug for double type of GetValue (#1995) This patch fixes the bug for double type of GetValue method. Signed-off-by: Sangjung Woo --- diff --git a/src/Tizen.MachineLearning.Inference/Tizen.MachineLearning.Inference/Pipeline.cs b/src/Tizen.MachineLearning.Inference/Tizen.MachineLearning.Inference/Pipeline.cs index ea9e8f9..d6abcae 100755 --- a/src/Tizen.MachineLearning.Inference/Tizen.MachineLearning.Inference/Pipeline.cs +++ b/src/Tizen.MachineLearning.Inference/Tizen.MachineLearning.Inference/Pipeline.cs @@ -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."); }