Browse Source

Update Math.Test.cs

tags/v0.110.0-LSTM-Model
RayWang Haiping 2 years ago
parent
commit
94edda54cd
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      test/TensorFlowNET.UnitTest/Numpy/Math.Test.cs

+ 12
- 0
test/TensorFlowNET.UnitTest/Numpy/Math.Test.cs View File

@@ -65,5 +65,17 @@ namespace TensorFlowNET.UnitTest.NumPy
var y = np.power(x, 3);
Assert.AreEqual(y, new[] { 0, 1, 8, 27, 64, 125 });
}
[TestMethod]
public void maximum()
{
var x1 = new NDArray(new[,] { { 1, 2, 3 }, { 4, 5.1, 6 } });
var x2 = new NDArray(new[,] { { 3, 2, 1 }, { 6, 5.1, 4 } });
var y = np.maximum(x1,x2);
var y1 = np.maximum(x1, x2, axis: 0);
var y2 = new NDArray(new[,] { { 3, 2, 3 }, { 6, 5.1, 6 } });
var y3 = new NDArray(new[] { 6, 5.1, 6 });
Assert.AreEqual(y, y2);
Assert.AreEqual(y1, y3);
}
}
}

Loading…
Cancel
Save