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.

LinalgTest.cs 594 B

123456789101112131415161718192021222324
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using static Tensorflow.Binding;
  6. namespace Tensorflow.UnitTest.TF_API
  7. {
  8. [TestClass]
  9. public class LinalgTest
  10. {
  11. [TestMethod]
  12. public void EyeTest()
  13. {
  14. var tensor = tf.linalg.eye(3);
  15. Assert.AreEqual((3, 3), tensor.TensorShape);
  16. Assert.AreEqual(0.0f, (float)tensor[2, 0]);
  17. Assert.AreEqual(0.0f, (float)tensor[2, 1]);
  18. Assert.AreEqual(1.0f, (float)tensor[2, 2]);
  19. }
  20. }
  21. }