parameters: (self, var_list=None)
return_statement: return per_graph_state
docstring: Either looks up or creates `_OptimizerV2State`.
  
      If any variables are available, they should be passed via the `var_list`
      argument, and these will be used to determine the graph to create/retrieve
      state for. Otherwise the returned state is for the current default graph.
  
      Args:
        var_list: A list of variables to extract a graph from.
  
      Returns:
        An `_OptimizerV2State` object.
docstring_summary: Either looks up or creates `_OptimizerV2State`.
docstring_tokens: Either looks up or creates _OptimizerV2State .
function: def _get_or_create_state(self, var_list=None):
      """Either looks up or creates `_OptimizerV2State`.
  
      If any variables are available, they should be passed via the `var_list`
      argument, and these will be used to determine the graph to create/retrieve
      state for. Otherwise the returned state is for the current default graph.
  
      Args:
        var_list: A list of variables to extract a graph from.
  
      Returns:
        An `_OptimizerV2State` object.
      """
      # Determine the graph_key from the current graph.
      eager_execution = context.executing_eagerly()
      if eager_execution or var_list is None:
        graph = ops.get_default_graph()
      else:
        graph = ops._get_graph_from_inputs(var_list)  # pylint: disable=protected-access
      assert graph is not None
      graph_key = graph._graph_key  # pylint: disable=protected-access
  
      # Get the per graph state by looking up the graph_key.
      if graph_key in self._per_graph_state:
        per_graph_state = self._per_graph_state[graph_key]
      else:
        per_graph_state = _OptimizerV2State(self._name)
        per_graph_state._init_with_static_hyper(self._hyper)  # pylint: disable=protected-access
        self._per_graph_state[graph_key] = per_graph_state
      return per_graph_state
function_tokens: def _get_or_create_state ( self , var_list = None ) : # Determine the graph_key from the current graph. eager_execution = context . executing_eagerly ( ) if eager_execution or var_list is None : graph = ops . get_default_graph ( ) else : graph = ops . _get_graph_from_inputs ( var_list ) # pylint: disable=protected-access assert graph is not None graph_key = graph . _graph_key # pylint: disable=protected-access # Get the per graph state by looking up the graph_key. if graph_key in self . _per_graph_state : per_graph_state = self . _per_graph_state [ graph_key ] else : per_graph_state = _OptimizerV2State ( self . _name ) per_graph_state . _init_with_static_hyper ( self . _hyper ) # pylint: disable=protected-access self . _per_graph_state [ graph_key ] = per_graph_state return per_graph_state