parameters: (self, op)
docstring: Adds 'op' to the graph.
  
      Args:
        op: the Operator or Tensor to add.
  
      Raises:
        TypeError: if op is not an Operation or Tensor.
        ValueError: if the op.name or op._id are already used.
docstring_summary: Adds 'op' to the graph.
docstring_tokens: Adds op to the graph .
function: def _add_op(self, op):
      """Adds 'op' to the graph.
  
      Args:
        op: the Operator or Tensor to add.
  
      Raises:
        TypeError: if op is not an Operation or Tensor.
        ValueError: if the op.name or op._id are already used.
      """
      self._check_not_finalized()
      if not isinstance(op, (Tensor, Operation)):
        raise TypeError("op must be a Tensor or Operation: %s" % op)
      with self._lock:
        # pylint: disable=protected-access
        if op._id in self._nodes_by_id:
          raise ValueError("cannot add an op with id %d as it already "
                           "exists in the graph" % op._id)
        if op.name in self._nodes_by_name:
          raise ValueError("cannot add op with name %s as that name "
                           "is already used" % op.name)
        self._nodes_by_id[op._id] = op
        self._nodes_by_name[op.name] = op
        self._version = max(self._version, op._id)
function_tokens: def _add_op ( self , op ) : self . _check_not_finalized ( ) if not isinstance ( op , ( Tensor , Operation ) ) : raise TypeError ( "op must be a Tensor or Operation: %s" % op ) with self . _lock : # pylint: disable=protected-access if op . _id in self . _nodes_by_id : raise ValueError ( "cannot add an op with id %d as it already " "exists in the graph" % op . _id ) if op . name in self . _nodes_by_name : raise ValueError ( "cannot add op with name %s as that name " "is already used" % op . name ) self . _nodes_by_id [ op . _id ] = op self . _nodes_by_name [ op . name ] = op self . _version = max ( self . _version , op . _id )