Skip to content

Commit 13f20d2

Browse files
pepureOceania2018
authored andcommitted
add Concat Double Type problem describe
1 parent 3e31304 commit 13f20d2

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎test/TensorFlowNET.UnitTest/TF_API/TensorOperate.cs‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,25 @@ public void InitTensorTest()
3232
Assert.IsTrue(Enumerable.SequenceEqual(new[] { 2, 3, 1 }, a.shape));
3333
Assert.IsTrue(Enumerable.SequenceEqual(new[] { 2, 3, 1 }, b.shape));
3434
}
35+
[TestMethod]
36+
public void ConcatTest()
37+
{
38+
var a = tf.constant(new[,] { { 1, 2 }, { 3, 4 } });
39+
var b = tf.constant(new[,] { { 5, 6 }, { 7, 8 } });
40+
var c = tf.constant(new[,] { { 9, 10 }, { 11, 12 } });
41+
42+
var concatValue = tf.concat(new[] { a, b, c }, axis: 0);
43+
Assert.IsTrue(Enumerable.SequenceEqual(new[] { 6, 2 }, concatValue.shape));
44+
}
45+
[TestMethod]
46+
public void ConcatDoubleTest()
47+
{//double type has some error
48+
var a = tf.constant(new[,] { { 1.0, 2.0 }, { 3.0, 4.0 } });
49+
var b = tf.constant(new[,] { { 5.0, 6.0 }, { 7.0, 8.0 } });
50+
var c = tf.constant(new[,] { { 9.0, 10.0 }, { 11.0, 12.0 } });
51+
52+
var concatValue = tf.concat(new[] { a, b, c }, axis: 0);
53+
Assert.IsTrue(Enumerable.SequenceEqual(new[] { 6, 2 }, concatValue.shape));
54+
}
3555
}
3656
}

0 commit comments

Comments
 (0)