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.

HelloWorld.cs 886 B

6 years ago
6 years ago
1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using tf = TensorFlowNET.Core.Tensorflow;
  5. namespace TensorFlowNET.Examples
  6. {
  7. /// <summary>
  8. /// Simple hello world using TensorFlow
  9. /// https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/1_Introduction/helloworld.py
  10. /// </summary>
  11. public class HelloWorld : IExample
  12. {
  13. public void Run()
  14. {
  15. /* # Create a Constant op
  16. The op is added as a node to the default graph.
  17. The value returned by the constructor represents the output
  18. of the Constant op.*/
  19. var graph = tf.get_default_graph();
  20. var hello = tf.constant(4.0);
  21. //var hello = tf.constant("Hello, TensorFlow!");
  22. // Start tf session
  23. // var sess = tf.Session();
  24. }
  25. }
  26. }

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

Contributors (1)