helloworld.py 481 B

123456789101112131415161718192021222324
  1. '''
  2. HelloWorld example using TensorFlow library.
  3. Author: Aymeric Damien
  4. Project: https://github.com/aymericdamien/TensorFlow-Examples/
  5. '''
  6. import tensorflow as tf
  7. #Simple hello world using TensorFlow
  8. # Create a Constant op
  9. # The op is added as a node to the default graph.
  10. #
  11. # The value returned by the constructor represents the output
  12. # of the Constant op.
  13. hello = tf.constant('Hello, TensorFlow!')
  14. # Start tf session
  15. sess = tf.Session()
  16. # Run the op
  17. print sess.run(hello)