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.

DatasetTest.cs 725 B

123456789101112131415161718192021222324252627282930
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using Tensorflow.UnitTest;
  6. using static Tensorflow.Binding;
  7. namespace TensorFlowNET.UnitTest.Dataset
  8. {
  9. [TestClass]
  10. public class DatasetTest : EagerModeTestBase
  11. {
  12. [TestMethod]
  13. public void Range()
  14. {
  15. int iStep = 0;
  16. long value = 0;
  17. var dataset = tf.data.Dataset.range(3);
  18. foreach(var (step, item) in enumerate(dataset))
  19. {
  20. Assert.AreEqual(iStep, step);
  21. iStep++;
  22. Assert.AreEqual(value, (long)item.Item1);
  23. value++;
  24. }
  25. }
  26. }
  27. }