Python‎ > ‎tensorflow‎ > ‎

equal

http://www.adilwaseem.com/

 The first tow of tensors are compared.
 
import tensorflow as tf
tensor1 = tf.constant(-1.5, shape=[5, 3])
tensor2 = tf.constant(-1.2, shape=[5, 3])
equal=tf.equal(tensor1[1],tensor2[1])

with tf.Session() as session:
    result=session.run(equal)
    print(result)

[False False False]
Comments