def _get_variables_to_train():
 if (FLAGS.trainable_scopes is None):
  return tf.trainable_variables()
 else:
  scopes = [scope.strip() for scope in FLAGS.trainable_scopes.split(',')]
 variables_to_train = []
 for scope in scopes:
  variables = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, scope)
  variables_to_train.extend(variables)
 return variables_to_train

def _get_variables_to_train ( ) : if ( FLAGS . trainable_scopes is None ) : return tf . trainable_variables ( ) else : scopes = [ scope . strip ( ) for scope in FLAGS . trainable_scopes . split ( ',' ) ] variables_to_train = [ ] for scope in scopes : variables = tf . get_collection ( tf . GraphKeys . TRAINABLE_VARIABLES , scope ) variables_to_train . extend ( variables ) return variables_to_train
returns a list of variables to train .