Browse Source

Remove ScanTest

tags/v0.20
Oceania2018 5 years ago
parent
commit
81215df6e6
3 changed files with 4 additions and 61 deletions
  1. +0
    -54
      test/TensorFlowNET.UnitTest/PythonBaseTests.cs
  2. +4
    -6
      test/TensorFlowNET.UnitTest/functional_ops_test/ScanTestCase.cs
  3. +0
    -1
      test/TensorFlowNET.UnitTest/ops_test/GraphTest.cs

+ 0
- 54
test/TensorFlowNET.UnitTest/PythonBaseTests.cs View File

@@ -1,54 +0,0 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Tensorflow;
using static Tensorflow.Binding;

namespace TensorFlowNET.UnitTest
{
[TestClass]
public class PythonBaseTests : PythonTest
{
[Ignore]
[TestMethod]
public void weakKeyDictionary_test()
{
var weakKeyDict = new WeakKeyDictionary<int, char>();
for (int i = 0; i < 5; i++)
{
var c = (char)((int)'a' + i);
weakKeyDict[i] = c;
//Assert.AreEqual(weakKeyDict.Count, (int)(i + 1));
var v = (weakKeyDict.Count == i + 1);
Assert.IsTrue(v);
}
//Assert.AreEqual(weakKeyDict.Count, 0);
var b = (weakKeyDict.Count == 0);
Assert.IsTrue(b);
}

[TestMethod]
public void isinstance_test()
{
var s1 = "hi";
var s2 = "hello";

var t1 = (s1, s2);
var t2 = (s1, s2, s1);
var t3 = (s2, s1);

var true1 = isinstance(s1, typeof(string));
var false1 = isinstance(t1, typeof(string));
var true2 = isinstance(t1, t3.GetType());
var false2 = isinstance(t1, t2.GetType());
var true3 = isinstance(t1, (t2.GetType(), t1.GetType(), typeof(string)));
var false3 = isinstance(t3, (t2.GetType(), typeof(string)));

Assert.IsTrue(true1);
Assert.IsTrue(true2);
Assert.IsTrue(true3);
Assert.IsFalse(false1);
Assert.IsFalse(false2);
Assert.IsFalse(false3);
}
}
}


+ 4
- 6
test/TensorFlowNET.UnitTest/functional_ops_test/ScanTestCase.cs View File

@@ -2,6 +2,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NumSharp;
using Tensorflow;
using Tensorflow.UnitTest;
using static Tensorflow.Binding;

namespace TensorFlowNET.UnitTest.functional_ops_test
@@ -9,12 +10,10 @@ namespace TensorFlowNET.UnitTest.functional_ops_test
/// <summary>
/// https://www.tensorflow.org/api_docs/python/tf/scan
/// </summary>
[Ignore]
[TestClass]
public class ScanTestCase
public class ScanTestCase : GraphModeTestBase
{
[Ignore("TODO")]
[TestMethod]
[TestMethod, Ignore("need UpdateEdge API")]
public void ScanForward()
{
var fn = new Func<Tensor, Tensor, Tensor>((a, x) => tf.add(a, x));
@@ -26,8 +25,7 @@ namespace TensorFlowNET.UnitTest.functional_ops_test
sess.run(scan, (input, np.array(1,2,3,4,5,6))).Should().Be(np.array(1,3,6,10,15,21));
}

[Ignore("TODO")]
[TestMethod]
[TestMethod, Ignore("need UpdateEdge API")]
public void ScanReverse()
{
var fn = new Func<Tensor, Tensor, Tensor>((a, x) => tf.add(a, x));


+ 0
- 1
test/TensorFlowNET.UnitTest/ops_test/GraphTest.cs View File

@@ -10,7 +10,6 @@ namespace TensorFlowNET.UnitTest.ops_test
[TestClass]
public class GraphTest : GraphModeTestBase
{

[TestInitialize]
public void SetUp()
{


Loading…
Cancel
Save