Browse Source

Add test case TypeMismatchedSliceAssign

tags/keras_v0.3.0
Banyc Haiping 4 years ago
parent
commit
b6755cc4a1
1 changed files with 20 additions and 0 deletions
  1. +20
    -0
      test/TensorFlowNET.UnitTest/Basics/VariableTest.cs

+ 20
- 0
test/TensorFlowNET.UnitTest/Basics/VariableTest.cs View File

@@ -83,6 +83,26 @@ namespace TensorFlowNET.UnitTest.Basics
Assert.AreEqual(nd[2], x[2].numpy());
}

[TestMethod, Ignore]
public void TypeMismatchedSliceAssign()
{
NDArray intNd = new int[]
{
1, -2, 3
};
NDArray doubleNd = new double[]
{
-5, 6, -7
};
var x = tf.Variable(doubleNd);

var slice = x[":"];
Assert.ThrowsException<System.Exception>(
// this statement exit without throwing any exception but the "test execution summary" seems not able to detect that.
() => slice.assign(intNd)
);
}

[TestMethod]
public void Accumulation()
{


Loading…
Cancel
Save