[MachineLearning.Train] Remove CheckException in Dispose method of all class
authorhyunil park <hyunil46.park@samsung.com>
Wed, 3 Aug 2022 08:27:31 +0000 (17:27 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Tue, 23 Aug 2022 05:50:26 +0000 (14:50 +0900)
- Remove CheckException since GC can not catch exception, this is a rule

Signed-off-by: hyunil park <hyunil46.park@samsung.com>
src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Commons.cs
src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Dataset.cs
src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Layer.cs
src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Model.cs
src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Optimizer.cs

index 471ef62..1780761 100644 (file)
@@ -220,7 +220,7 @@ namespace Tizen.MachineLearning.Train
         /// <summary>
         /// Stochastic Gradient Descent Optimizer
         /// </summary>
-        Sgd = 1,
+        SGD = 1,
         /// <summary>
         /// Unknown Optimizer
         /// </summary>
index 51620c5..25747ad 100644 (file)
@@ -82,8 +82,8 @@ namespace Tizen.MachineLearning.Train
             {
                 // Destroy dataset.
                 NNTrainerError ret = Interop.Dataset.Destroy(handle);
-                NNTrainer.CheckException(ret, "Failed to destroy dataset instance");
-                Log.Info(NNTrainer.Tag, "Destroy Dataset");
+                if (ret != NNTrainerError.None)
+                    Log.Error(NNTrainer.Tag, "Failed to destroy Dataset instance");
 
                 handle = IntPtr.Zero;
             }
index 2135fa1..a34c17f 100644 (file)
@@ -103,7 +103,8 @@ namespace Tizen.MachineLearning.Train
             {
                 // Destroy the neural network layer.
                 NNTrainerError ret = Interop.Layer.Destroy(handle);
-                NNTrainer.CheckException(ret, "Failed to destroy layer instance");
+                if (ret != NNTrainerError.None)
+                    Log.Error(NNTrainer.Tag, "Failed to destroy Layer instance");
 
                 handle = IntPtr.Zero;
             }
index 1b053b0..cfb1106 100644 (file)
@@ -100,8 +100,8 @@ namespace Tizen.MachineLearning.Train
             {
                 // Destroy the neural network model.
                 NNTrainerError ret = Interop.Model.Destroy(handle);
-                NNTrainer.CheckException(ret, "Failed to destroy model instance");
-
+                if (ret != NNTrainerError.None)
+                    Log.Error(NNTrainer.Tag, "Failed to destroy Model instance");
                 handle = IntPtr.Zero;
             }
             disposed = true;
index a8ac08b..abc2a14 100644 (file)
@@ -84,7 +84,8 @@ namespace Tizen.MachineLearning.Train
             {
                 // Destroy optimizer.
                 NNTrainerError ret = Interop.Optimizer.Destroy(handle);
-                NNTrainer.CheckException(ret, "Failed to destroy optimizer instance");
+                if (ret != NNTrainerError.None)
+                    Log.Error(NNTrainer.Tag, "Failed to destroy Optimizer instance");
 
                 handle = IntPtr.Zero;
             }