parameters: (self, obj, allow_tensor=True, allow_operation=True)
docstring: Returns the object referred to by `obj`, as an `Operation` or `Tensor`.
  
      This function validates that `obj` represents an element of this
      graph, and gives an informative error message if it is not.
  
      This function is the canonical way to get/validate an object of
      one of the allowed types from an external argument reference in the
      Session API.
  
      This method may be called concurrently from multiple threads.
  
      Args:
        obj: A `Tensor`, an `Operation`, or the name of a tensor or operation.
          Can also be any object with an `_as_graph_element()` method that returns
          a value of one of these types.
        allow_tensor: If true, `obj` may refer to a `Tensor`.
        allow_operation: If true, `obj` may refer to an `Operation`.
  
      Returns:
        The `Tensor` or `Operation` in the Graph corresponding to `obj`.
  
      Raises:
        TypeError: If `obj` is not a type we support attempting to convert
          to types.
        ValueError: If `obj` is of an appropriate type but invalid. For
          example, an invalid string.
        KeyError: If `obj` is not an object in the graph.
docstring_summary: Returns the object referred to by `obj`, as an `Operation` or `Tensor`.
docstring_tokens: Returns the object referred to by obj as an Operation or Tensor .
function: def as_graph_element(self, obj, allow_tensor=True, allow_operation=True):
      """Returns the object referred to by `obj`, as an `Operation` or `Tensor`.
  
      This function validates that `obj` represents an element of this
      graph, and gives an informative error message if it is not.
  
      This function is the canonical way to get/validate an object of
      one of the allowed types from an external argument reference in the
      Session API.
  
      This method may be called concurrently from multiple threads.
  
      Args:
        obj: A `Tensor`, an `Operation`, or the name of a tensor or operation.
          Can also be any object with an `_as_graph_element()` method that returns
          a value of one of these types.
        allow_tensor: If true, `obj` may refer to a `Tensor`.
        allow_operation: If true, `obj` may refer to an `Operation`.
  
      Returns:
        The `Tensor` or `Operation` in the Graph corresponding to `obj`.
  
      Raises:
        TypeError: If `obj` is not a type we support attempting to convert
          to types.
        ValueError: If `obj` is of an appropriate type but invalid. For
          example, an invalid string.
        KeyError: If `obj` is not an object in the graph.
      """
      if self._finalized:
        return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
  
      with self._lock:
        return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
function_tokens: def as_graph_element ( self , obj , allow_tensor = True , allow_operation = True ) : if self . _finalized : return self . _as_graph_element_locked ( obj , allow_tensor , allow_operation ) with self . _lock : return self . _as_graph_element_locked ( obj , allow_tensor , allow_operation )