def initialize_global_variables(sess=None):
 assert (sess is not None)
 try:
  sess.run(tf.global_variables_initializer())
 except:
  sess.run(tf.initialize_all_variables())

def initialize_global_variables ( sess = None ) : assert ( sess is not None ) try : sess . run ( tf . global_variables_initializer ( ) ) except : sess . run ( tf . initialize_all_variables ( ) )
excute sess .