parameters: ()
return_statement: return _GRAPH_LEARNING_PHASES[graph]
docstring: Returns the learning phase flag.
  
    The learning phase flag is a bool tensor (0 = test, 1 = train)
    to be passed as input to any Keras function
    that uses a different behavior at train time and test time.
  
    Returns:
        Learning phase (scalar integer tensor or Python integer).
docstring_summary: Returns the learning phase flag.
docstring_tokens: Returns the learning phase flag .
function: def learning_phase():
    """Returns the learning phase flag.
  
    The learning phase flag is a bool tensor (0 = test, 1 = train)
    to be passed as input to any Keras function
    that uses a different behavior at train time and test time.
  
    Returns:
        Learning phase (scalar integer tensor or Python integer).
    """
    graph = ops.get_default_graph()
    if graph not in _GRAPH_LEARNING_PHASES:
      phase = array_ops.placeholder(dtype='bool', name='keras_learning_phase')
      _GRAPH_LEARNING_PHASES[graph] = phase
    return _GRAPH_LEARNING_PHASES[graph]
function_tokens: def learning_phase ( ) : graph = ops . get_default_graph ( ) if graph not in _GRAPH_LEARNING_PHASES : phase = array_ops . placeholder ( dtype = 'bool' , name = 'keras_learning_phase' ) _GRAPH_LEARNING_PHASES [ graph ] = phase return _GRAPH_LEARNING_PHASES [ graph ]