Python‎ > ‎

Control Flow


Introduction
Python execute if state subject to condition. 

Example
The method returns as:
 x = input()
if x=="Adil":
    print("You're speaking true")
elif x == "John":
    print("No, you are not Adil")
else:
    print("you're not allowed to use this system")

 The tensor shape is predicted through if statement.
import tensorflow as tf
import math
a=math.cos(1)
b=math.cos(1)
c=math.cos(1)
t = tf.constant([a,b,c])
s=tf.shape(t)

with tf.Session() as session:
    r=session.run(s)
    if r==3:
        print("yes")        
 >>yes


Comments