def get_unique_variable(name):
 candidates = tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, name)
 if (not candidates):
  raise ValueError(('Couldnt find variable %s' % name))
 for candidate in candidates:
  if (candidate.op.name == name):
   return candidate
 raise ValueError('Variable %s does not uniquely identify a variable', name)

def get_unique_variable ( name ) : candidates = tf . get_collection ( tf . GraphKeys . GLOBAL_VARIABLES , name ) if ( not candidates ) : raise ValueError ( ( 'Couldnt find variable %s' % name ) ) for candidate in candidates : if ( candidate . op . name == name ) : return candidate raise ValueError ( 'Variable %s does not uniquely identify a variable' , name )
gets the variable uniquely identified by that name .