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.

NegativeTests.cs 618 B

123456789101112131415161718192021222324
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using Tensorflow;
  3. using static Tensorflow.Python;
  4. namespace TensorFlowNET.UnitTest.Basics
  5. {
  6. [TestClass]
  7. public sealed class NegativeTests
  8. {
  9. [TestMethod]
  10. public void ShouldReturnNegative()
  11. {
  12. var x = tf.constant(new[,] { { 1, 2 } });
  13. var neg_x = tf.negative(x);
  14. with(tf.Session(), session =>
  15. {
  16. var result = session.run(neg_x);
  17. Assert.AreEqual(result[0][0], -1);
  18. Assert.AreEqual(result[0][1], -2);
  19. });
  20. }
  21. }
  22. }