helloworld.py 522 B

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