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

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