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.

Math.Test.cs 645 B

4 years ago
1234567891011121314151617181920212223242526
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using Tensorflow.NumPy;
  7. namespace TensorFlowNET.UnitTest.Numpy
  8. {
  9. /// <summary>
  10. /// https://numpy.org/doc/stable/reference/generated/numpy.prod.html
  11. /// </summary>
  12. [TestClass]
  13. public class NumpyMathTest : EagerModeTestBase
  14. {
  15. [TestMethod]
  16. public void prod()
  17. {
  18. var p = np.prod(1.0, 2.0);
  19. Assert.AreEqual(p, 2.0);
  20. p = np.prod(new[,] { { 1.0, 2.0 }, { 3.0, 4.0 } });
  21. Assert.AreEqual(p, 24.0);
  22. }
  23. }
  24. }