SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import tensorflow as tf
  2.  
  3. x = tf.constant([69, 34, 98])
  4. y = tf.constant([98, 67, 89])
  5. z1 = x - y  #Common arethmetic operation can be used directly
  6. z2 = x * y
  7. z3 = tf.add(z1, z2)
  8.  
  9. with tf.Session() as sess:
  10.     print("z1 is {}".format(z1.eval()))
  11.     print("z2 is  {}".format(z2.eval()))
  12.     print("z3 is {}".format(z3.eval()))
  13.  
  14. ''' we are executing the graph using lazy loading, the result is :
  15.     z1 is [-29 -33   9]
  16.     z2 is  [6762 2278 8722]
  17.     z3 is [6733 2245 8731]
  18. '''
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top