Browse Source

add Concat Double Type problem describe

tags/v0.20
pepure Haiping 5 years ago
parent
commit
13f20d28fd
1 changed files with 20 additions and 0 deletions
  1. +20
    -0
      test/TensorFlowNET.UnitTest/TF_API/TensorOperate.cs

+ 20
- 0
test/TensorFlowNET.UnitTest/TF_API/TensorOperate.cs View File

@@ -32,5 +32,25 @@ namespace Tensorflow.UnitTest.TF_API
Assert.IsTrue(Enumerable.SequenceEqual(new[] { 2, 3, 1 }, a.shape));
Assert.IsTrue(Enumerable.SequenceEqual(new[] { 2, 3, 1 }, b.shape));
}
[TestMethod]
public void ConcatTest()
{
var a = tf.constant(new[,] { { 1, 2 }, { 3, 4 } });
var b = tf.constant(new[,] { { 5, 6 }, { 7, 8 } });
var c = tf.constant(new[,] { { 9, 10 }, { 11, 12 } });

var concatValue = tf.concat(new[] { a, b, c }, axis: 0);
Assert.IsTrue(Enumerable.SequenceEqual(new[] { 6, 2 }, concatValue.shape));
}
[TestMethod]
public void ConcatDoubleTest()
{//double type has some error
var a = tf.constant(new[,] { { 1.0, 2.0 }, { 3.0, 4.0 } });
var b = tf.constant(new[,] { { 5.0, 6.0 }, { 7.0, 8.0 } });
var c = tf.constant(new[,] { { 9.0, 10.0 }, { 11.0, 12.0 } });

var concatValue = tf.concat(new[] { a, b, c }, axis: 0);
Assert.IsTrue(Enumerable.SequenceEqual(new[] { 6, 2 }, concatValue.shape));
}
}
}

Loading…
Cancel
Save