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

6 years ago
1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Linq;
  3. using System.Reflection;
  4. namespace TensorFlowNET.Examples
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. var assembly = Assembly.GetEntryAssembly();
  11. foreach(Type type in assembly.GetTypes().Where(x => x.GetInterfaces().Contains(typeof(IExample))))
  12. {
  13. if (args.Length > 0 && !args.Contains(type.Name))
  14. continue;
  15. var example = (IExample)Activator.CreateInstance(type);
  16. try
  17. {
  18. example.Run();
  19. }
  20. catch (Exception ex)
  21. {
  22. Console.WriteLine(ex);
  23. }
  24. }
  25. Console.ReadLine();
  26. }
  27. }
  28. }

tensorflow框架的.NET版本,提供了丰富的特性和API,可以借此很方便地在.NET平台下搭建深度学习训练与推理流程。