diff --git a/test/TensorFlowNET.UnitTest/Basics/SessionTest.cs b/test/TensorFlowNET.UnitTest/Basics/SessionTest.cs index e87c454b..a012a005 100644 --- a/test/TensorFlowNET.UnitTest/Basics/SessionTest.cs +++ b/test/TensorFlowNET.UnitTest/Basics/SessionTest.cs @@ -14,7 +14,6 @@ using static Tensorflow.Binding; namespace TensorFlowNET.UnitTest.NativeAPI { - [Ignore] [TestClass] public class SessionTest : CApiTest { @@ -22,7 +21,7 @@ namespace TensorFlowNET.UnitTest.NativeAPI /// tensorflow\c\c_api_test.cc /// `TEST(CAPI, Session)` /// - [TestMethod, Ignore] + [TestMethod] public void Session() { lock (Locks.ProcessWide) diff --git a/test/TensorFlowNET.UnitTest/Basics/TensorTest.cs b/test/TensorFlowNET.UnitTest/Basics/TensorTest.cs index 86df2039..6d67d927 100644 --- a/test/TensorFlowNET.UnitTest/Basics/TensorTest.cs +++ b/test/TensorFlowNET.UnitTest/Basics/TensorTest.cs @@ -11,7 +11,6 @@ using Tensorflow.Framework; namespace TensorFlowNET.UnitTest.NativeAPI { - [Ignore] [TestClass] public class TensorTest : CApiTest { @@ -81,7 +80,7 @@ namespace TensorFlowNET.UnitTest.NativeAPI /// Port from c_api_test.cc /// `TEST(CAPI, MaybeMove)` /// - [TestMethod] + [TestMethod, Ignore] public void MaybeMove() { NDArray nd = np.array(2, 3); @@ -262,13 +261,17 @@ namespace TensorFlowNET.UnitTest.NativeAPI } } - [TestMethod] + [TestMethod, Ignore] public void boolean_mask() { var tensor = new[] { 0, 1, 2, 3 }; var mask = np.array(new[] { true, false, true, false }); var masked = tf.boolean_mask(tensor, mask); - Assert.IsTrue(Enumerable.SequenceEqual(new int[] { 0, 2 }, masked.ToArray())); + using (var sess = tf.Session()) + { + var result = sess.run(masked); + Assert.IsTrue(Enumerable.SequenceEqual(new int[] { 0, 2 }, masked.ToArray())); + } } } } \ No newline at end of file diff --git a/test/TensorFlowNET.UnitTest/GradientTest/GradientTest.cs b/test/TensorFlowNET.UnitTest/GradientTest/GradientTest.cs index dcd274a8..66e5092d 100644 --- a/test/TensorFlowNET.UnitTest/GradientTest/GradientTest.cs +++ b/test/TensorFlowNET.UnitTest/GradientTest/GradientTest.cs @@ -4,13 +4,13 @@ using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using NumSharp; using Tensorflow; +using Tensorflow.UnitTest; using static Tensorflow.Binding; namespace TensorFlowNET.UnitTest.Gradient { - [Ignore] [TestClass] - public class GradientTest : PythonTest + public class GradientTest : GraphModeTestBase { [TestMethod] public void BroadcastToGrad() @@ -45,7 +45,6 @@ namespace TensorFlowNET.UnitTest.Gradient } } - [Ignore("TODO")] [TestMethod] public void testGradients() { diff --git a/test/TensorFlowNET.UnitTest/Keras/EmbeddingTest.cs b/test/TensorFlowNET.UnitTest/Keras/EmbeddingTest.cs index d3484d5e..93aa1cab 100644 --- a/test/TensorFlowNET.UnitTest/Keras/EmbeddingTest.cs +++ b/test/TensorFlowNET.UnitTest/Keras/EmbeddingTest.cs @@ -5,6 +5,7 @@ using System.Text; using Tensorflow.Keras.Engine; using Tensorflow.Keras.Layers; using NumSharp; +using Tensorflow.UnitTest; namespace TensorFlowNET.UnitTest.Keras { @@ -12,9 +13,8 @@ namespace TensorFlowNET.UnitTest.Keras /// https://www.tensorflow.org/versions/r1.14/api_docs/python/tf/keras/layers/Embedding /// [TestClass] - public class EmbeddingTest + public class EmbeddingTest : GraphModeTestBase { - [Ignore] [TestMethod] public void Embedding() { diff --git a/test/TensorFlowNET.UnitTest/NativeAPI/CApiAttributesTestcs.cs b/test/TensorFlowNET.UnitTest/NativeAPI/CApiAttributesTestcs.cs index d5a816c8..0a18f63f 100644 --- a/test/TensorFlowNET.UnitTest/NativeAPI/CApiAttributesTestcs.cs +++ b/test/TensorFlowNET.UnitTest/NativeAPI/CApiAttributesTestcs.cs @@ -8,7 +8,6 @@ namespace TensorFlowNET.UnitTest.NativeAPI /// tensorflow\c\c_api_test.cc /// `class CApiAttributesTest` /// - [Ignore] [TestClass] public class CApiAttributesTestcs : CApiTest, IDisposable { diff --git a/test/TensorFlowNET.UnitTest/NativeAPI/CApiColocationTest.cs b/test/TensorFlowNET.UnitTest/NativeAPI/CApiColocationTest.cs index 64f6b2f2..9d892199 100644 --- a/test/TensorFlowNET.UnitTest/NativeAPI/CApiColocationTest.cs +++ b/test/TensorFlowNET.UnitTest/NativeAPI/CApiColocationTest.cs @@ -9,7 +9,6 @@ namespace TensorFlowNET.UnitTest.NativeAPI /// tensorflow\c\c_api_test.cc /// `class CApiColocationTest` /// - [Ignore] [TestClass] public class CApiColocationTest : CApiTest, IDisposable { diff --git a/test/TensorFlowNET.UnitTest/NativeAPI/CApiGradientsTest.cs b/test/TensorFlowNET.UnitTest/NativeAPI/CApiGradientsTest.cs index 597b08ed..f5f96338 100644 --- a/test/TensorFlowNET.UnitTest/NativeAPI/CApiGradientsTest.cs +++ b/test/TensorFlowNET.UnitTest/NativeAPI/CApiGradientsTest.cs @@ -11,7 +11,7 @@ namespace TensorFlowNET.UnitTest.NativeAPI /// tensorflow\c\c_api_test.cc /// `class CApiGradientsTest` /// - [TestClass, Ignore] + [TestClass] public class CApiGradientsTest : CApiTest, IDisposable { private Graph graph_ = new Graph(); diff --git a/test/TensorFlowNET.UnitTest/NativeAPI/CApiTest.cs b/test/TensorFlowNET.UnitTest/NativeAPI/CApiTest.cs index 84a2f045..4b9f061a 100644 --- a/test/TensorFlowNET.UnitTest/NativeAPI/CApiTest.cs +++ b/test/TensorFlowNET.UnitTest/NativeAPI/CApiTest.cs @@ -3,11 +3,12 @@ using System; using Tensorflow; using Tensorflow.Device; using Tensorflow.Eager; +using Tensorflow.UnitTest; using Buffer = System.Buffer; namespace TensorFlowNET.UnitTest { - public class CApiTest + public class CApiTest : GraphModeTestBase { protected static readonly TF_Code TF_OK = TF_Code.TF_OK; protected static readonly TF_DataType TF_FLOAT = TF_DataType.TF_FLOAT; diff --git a/test/TensorFlowNET.UnitTest/TF_API/ZeroFractionTest.cs b/test/TensorFlowNET.UnitTest/TF_API/ZeroFractionTest.cs index eb0fdce7..f87b3c01 100644 --- a/test/TensorFlowNET.UnitTest/TF_API/ZeroFractionTest.cs +++ b/test/TensorFlowNET.UnitTest/TF_API/ZeroFractionTest.cs @@ -3,11 +3,12 @@ using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using NumSharp; using Tensorflow; +using Tensorflow.UnitTest; namespace TensorFlowNET.UnitTest.nn_test { [TestClass] - public class ZeroFractionTest : PythonTest + public class ZeroFractionTest : GraphModeTestBase { protected double _ZeroFraction(NDArray x) { diff --git a/test/TensorFlowNET.UnitTest/nest_test/NestTest.cs b/test/TensorFlowNET.UnitTest/nest_test/NestTest.cs index 4b314752..0780d052 100644 --- a/test/TensorFlowNET.UnitTest/nest_test/NestTest.cs +++ b/test/TensorFlowNET.UnitTest/nest_test/NestTest.cs @@ -5,6 +5,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json.Linq; using NumSharp; using Tensorflow; +using Tensorflow.UnitTest; using Tensorflow.Util; using static Tensorflow.Binding; @@ -14,7 +15,7 @@ namespace TensorFlowNET.UnitTest.nest_test /// excerpt of tensorflow/python/framework/util/nest_test.py /// [TestClass] - public class NestTest : PythonTest + public class NestTest : GraphModeTestBase { [TestInitialize] public void TestInitialize() diff --git a/test/TensorFlowNET.UnitTest/ops_test/CreateOpFromTfOperationTest.cs b/test/TensorFlowNET.UnitTest/ops_test/CreateOpFromTfOperationTest.cs index 1d6c4219..eca4c0e0 100644 --- a/test/TensorFlowNET.UnitTest/ops_test/CreateOpFromTfOperationTest.cs +++ b/test/TensorFlowNET.UnitTest/ops_test/CreateOpFromTfOperationTest.cs @@ -3,6 +3,7 @@ using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using Tensorflow; using Tensorflow.Operations; +using Tensorflow.UnitTest; using static Tensorflow.Binding; namespace TensorFlowNET.UnitTest.ops_test @@ -19,7 +20,7 @@ namespace TensorFlowNET.UnitTest.ops_test /// [Ignore] [TestClass] - public class CreateOpFromTfOperationTest : PythonTest + public class CreateOpFromTfOperationTest : GraphModeTestBase { [TestMethod] diff --git a/test/TensorFlowNET.UnitTest/ops_test/GraphTest.cs b/test/TensorFlowNET.UnitTest/ops_test/GraphTest.cs index 6b0c1176..938247c9 100644 --- a/test/TensorFlowNET.UnitTest/ops_test/GraphTest.cs +++ b/test/TensorFlowNET.UnitTest/ops_test/GraphTest.cs @@ -1,14 +1,14 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Tensorflow; +using Tensorflow.UnitTest; namespace TensorFlowNET.UnitTest.ops_test { /// /// excerpt of tensorflow/python/framework/ops_test.py /// - [Ignore] [TestClass] - public class GraphTest : PythonTest + public class GraphTest : GraphModeTestBase { [TestInitialize]