You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Layers.Merging.Test.cs 757 B

123456789101112131415161718192021222324
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System.Collections.Generic;
  3. using Tensorflow.NumPy;
  4. using static Tensorflow.KerasApi;
  5. namespace Tensorflow.Keras.UnitTest.Layers
  6. {
  7. [TestClass]
  8. public class LayersMergingTest : EagerModeTestBase
  9. {
  10. [TestMethod]
  11. [DataRow(1, 4, 1, 5)]
  12. [DataRow(2, 2, 2, 5)]
  13. [DataRow(3, 2, 1, 10)]
  14. public void Concatenate(int axis, int shapeA, int shapeB, int shapeC)
  15. {
  16. var x = np.arange(10).reshape((1, 2, 1, 5));
  17. var y = np.arange(10, 20).reshape((1, 2, 1, 5));
  18. var z = keras.layers.Concatenate(axis: axis).Apply(new Tensors(x, y));
  19. Assert.AreEqual((1, shapeA, shapeB, shapeC), z.shape);
  20. }
  21. }
  22. }