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.

RepeatDataSetCrash.cs 755 B

12345678910111213141516171819202122232425262728
  1. using BenchmarkDotNet.Attributes;
  2. using System;
  3. using System.Collections.Generic;
  4. using Tensorflow.NumPy;
  5. using static Tensorflow.Binding;
  6. using static Tensorflow.KerasApi;
  7. namespace Tensorflow.Benchmark.Crash
  8. {
  9. public class RepeatDataSetCrash
  10. {
  11. [Benchmark]
  12. public void Run()
  13. {
  14. var data = tf.convert_to_tensor(np.arange(0, 50000 * 10).astype(np.float32).reshape((50000, 10)));
  15. var dataset = keras.preprocessing.timeseries_dataset_from_array(data,
  16. sequence_length: 10,
  17. sequence_stride: 1,
  18. shuffle: false,
  19. batch_size: 32);
  20. while (true)
  21. foreach (var d in dataset)
  22. ;
  23. }
  24. }
  25. }