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.

PlaceholderTest.cs 621 B

6 years ago
6 years ago
6 years ago
6 years ago
123456789101112131415161718192021222324252627
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using Tensorflow;
  6. using static Tensorflow.Python;
  7. namespace TensorFlowNET.UnitTest
  8. {
  9. [TestClass]
  10. public class PlaceholderTest
  11. {
  12. [TestMethod]
  13. public void placeholder()
  14. {
  15. var x = tf.placeholder(tf.int32);
  16. var y = x * 3;
  17. with(tf.Session(), sess =>
  18. {
  19. var result = sess.run(y,
  20. new FeedItem(x, 2));
  21. Assert.AreEqual((int)result, 6);
  22. });
  23. }
  24. }
  25. }