pastebin

Paste Search Dynamic
Recent pastes
tf subtract
  1. import tensorflow as tf
  2.  
  3. # Define input data
  4. x = tf.constant(2, dtype=tf.float32)
  5. y = tf.constant(3, dtype=tf.float32)
  6.  
  7. # Define operations
  8. addition = tf.add(x, y)
  9. multiplication = tf.multiply(x, y)
  10.  
  11. # Define output
  12. result = tf.subtract(multiplication, addition)
  13.  
  14. # Create a session and run the graph
  15. with tf.compat.v1.Session() as sess:
  16.     output = sess.run(result)
  17. print("Result: ", output)
Parsed in 0.009 seconds