Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. import tensorflow as tf
  2.  
  3. a = tf.constant(1,tf.int32);
  4. b = tf.constant(1,tf.int32);
  5.  
  6. c = tf.add(a,b);
  7.  
  8.  
  9. print(c);
  10.  
  11. import tensorflow as tf
  12.  
  13. tf.enable_eager_execution();
  14.  
  15. a = tf.constant(1, tf.int32);
  16. b = tf.constant(1, tf.int32);
  17.  
  18.  
  19. @tf.function()
  20. def sum(i,j):
  21. c = tf.add(i,j);
  22. return c;
  23.  
  24.  
  25. print(sum(a,b));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement