tensorflow8_feeds.py 601 B

1234567891011121314151617
  1. # View more python learning tutorial on my Youtube and Youku channel!!!
  2. # Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
  3. # Youku video tutorial: http://i.youku.com/pythontutorial
  4. """
  5. Please note, this code is only for python 3+. If you are using python 2+, please modify the code accordingly.
  6. """
  7. from __future__ import print_function
  8. import tensorflow as tf
  9. input1 = tf.placeholder(tf.float32)
  10. input2 = tf.placeholder(tf.float32)
  11. output = tf.multiply(input1, input2)
  12. with tf.Session() as sess:
  13. print(sess.run(output, feed_dict={input1: [7.], input2: [2.]}))