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 531 B

123456789101112131415161718192021
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using static Tensorflow.Binding;
  3. namespace TensorFlowNET.UnitTest.ManagedAPI
  4. {
  5. [TestClass]
  6. public class LinalgTest
  7. {
  8. [TestMethod]
  9. public void EyeTest()
  10. {
  11. var tensor = tf.linalg.eye(3);
  12. Assert.AreEqual(tensor.shape, (3, 3));
  13. Assert.AreEqual(0.0f, (double)tensor[2, 0]);
  14. Assert.AreEqual(0.0f, (double)tensor[2, 1]);
  15. Assert.AreEqual(1.0f, (double)tensor[2, 2]);
  16. }
  17. }
  18. }