Guest User

Untitled

a guest
Jun 20th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. import tensorflow as tf
  2.  
  3. mat1 = [0,1,2]
  4. mat2 = [2,1,0]
  5.  
  6. with tf.device('/gpu:0'):
  7. tn1 = tf.placeholder(dtype= tf.int32, shape=[3])
  8. tn2 = tf.placeholder(dtype= tf.int32, shape=[3])
  9. tn3 = tn1 + tn2
  10.  
  11. with tf.Session() as sess:
  12. result = sess.run(tn3,{tn1:mat1,tn2:mat2})
  13. print(result)
Add Comment
Please, Sign In to add comment