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.

Program.cs 1.2 kB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using BenchmarkDotNet.Configs;
  2. using BenchmarkDotNet.Running;
  3. using System;
  4. using System.Reflection;
  5. using Tensorflow.Benchmark.Crash;
  6. using Tensorflow.Benchmark.Leak;
  7. using static Tensorflow.Binding;
  8. namespace TensorFlowBenchmark
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. print(tf.VERSION);
  15. /*new SavedModelCleanup().Run();
  16. new RepeatDataSetCrash().Run();
  17. new GpuLeakByCNN().Run();*/
  18. if (args?.Length > 0)
  19. {
  20. for (int i = 0; i < args.Length; i++)
  21. {
  22. string name = $"TensorFlowBenchmark.{args[i]}";
  23. var type = Type.GetType(name);
  24. BenchmarkRunner.Run(type);
  25. }
  26. }
  27. else
  28. {
  29. #pragma warning disable CS0618 // Type or member is obsolete
  30. BenchmarkSwitcher.FromAssembly(Assembly.GetExecutingAssembly()).Run(args, ManualConfig.Create(DefaultConfig.Instance).With(ConfigOptions.DisableOptimizationsValidator));
  31. #pragma warning restore CS0618 // Type or member is obsolete
  32. }
  33. Console.ReadLine();
  34. }
  35. }
  36. }