parameters: (clazz_object, operator, func)
docstring: Overrides (string) operator on Tensors to call func.
  
    Args:
      clazz_object: the class to override for; either Tensor or SparseTensor.
      operator: the string name of the operator to override.
      func: the function that replaces the overriden operator.
  
    Raises:
      ValueError: If operator has already been overwritten,
        or if operator is not allowed to be overwritten.
docstring_summary: Overrides (string) operator on Tensors to call func.
docstring_tokens: Overrides ( string ) operator on Tensors to call func .
function: def _override_helper(clazz_object, operator, func):
    """Overrides (string) operator on Tensors to call func.
  
    Args:
      clazz_object: the class to override for; either Tensor or SparseTensor.
      operator: the string name of the operator to override.
      func: the function that replaces the overriden operator.
  
    Raises:
      ValueError: If operator has already been overwritten,
        or if operator is not allowed to be overwritten.
    """
    existing = getattr(clazz_object, operator, None)
    if existing is not None:
      # Check to see if this is a default method-wrapper or slot wrapper which
      # will be true for the comparison operators.
      if not isinstance(existing, type(object.__lt__)):
        raise ValueError("operator %s cannot be overwritten again on class %s." %
                         (operator, clazz_object))
    if operator not in Tensor.OVERLOADABLE_OPERATORS:
      raise ValueError("Overriding %s is disallowed" % operator)
    setattr(clazz_object, operator, func)
function_tokens: def _override_helper ( clazz_object , operator , func ) : existing = getattr ( clazz_object , operator , None ) if existing is not None : # Check to see if this is a default method-wrapper or slot wrapper which # will be true for the comparison operators. if not isinstance ( existing , type ( object . __lt__ ) ) : raise ValueError ( "operator %s cannot be overwritten again on class %s." % ( operator , clazz_object ) ) if operator not in Tensor . OVERLOADABLE_OPERATORS : raise ValueError ( "Overriding %s is disallowed" % operator ) setattr ( clazz_object , operator , func )