parameters: (x, y, name=None)
return_statement: return out
docstring: This layer returns the truth value of :math:`x == y` elementwise.
  
      **NOTICE**: The output of this OP has no gradient.
  
      Args:
          x(Tensor): Tensor, data type is bool, float32, float64, int32, int64.
          y(Tensor): Tensor, data type is bool, float32, float64, int32, int64.
          name(str, optional): The default value is None.  Normally there is no need for
              user to set this property.  For more information, please refer to :ref:`api_guide_Name`.
  
      Returns:
          Tensor: output Tensor, it's shape is the same as the input's Tensor,
          and the data type is bool. The result of this op is stop_gradient. 
  
      Examples:
          .. code-block:: python
  
            import paddle
  
            x = paddle.to_tensor([1, 2, 3])
            y = paddle.to_tensor([1, 3, 2])
            result1 = paddle.equal(x, y)
            print(result1)  # result1 = [True False False]
function: def equal(x, y, name=None):
      """
  
      This layer returns the truth value of :math:`x == y` elementwise.
  
      **NOTICE**: The output of this OP has no gradient.
  
      Args:
          x(Tensor): Tensor, data type is bool, float32, float64, int32, int64.
          y(Tensor): Tensor, data type is bool, float32, float64, int32, int64.
          name(str, optional): The default value is None.  Normally there is no need for
              user to set this property.  For more information, please refer to :ref:`api_guide_Name`.
  
      Returns:
          Tensor: output Tensor, it's shape is the same as the input's Tensor,
          and the data type is bool. The result of this op is stop_gradient. 
  
      Examples:
          .. code-block:: python
  
            import paddle
  
            x = paddle.to_tensor([1, 2, 3])
            y = paddle.to_tensor([1, 3, 2])
            result1 = paddle.equal(x, y)
            print(result1)  # result1 = [True False False]
      """
      if not isinstance(y, (int, bool, float, Variable)):
          raise TypeError(
              "Type of input args must be float, bool, int or Tensor, but received type {}".
              format(type(y)))
      if not isinstance(y, Variable):
          y = full(shape=[1], dtype=x.dtype, fill_value=y)
  
      if in_dygraph_mode():
          return _C_ops.equal(x, y)
  
      check_variable_and_dtype(
          x, "x", ["bool", "float32", "float64", "int32", "int64"], "equal")
      check_variable_and_dtype(
          y, "y", ["bool", "float32", "float64", "int32", "int64"], "equal")
      helper = LayerHelper("equal", **locals())
      out = helper.create_variable_for_type_inference(dtype='bool')
      out.stop_gradient = True
  
      helper.append_op(
          type='equal', inputs={'X': [x],
                                'Y': [y]}, outputs={'Out': [out]})
      return out
function_tokens: def equal ( x , y , name = None ) : if not isinstance ( y , ( int , bool , float , Variable ) ) : raise TypeError ( "Type of input args must be float, bool, int or Tensor, but received type {}" . format ( type ( y ) ) ) if not isinstance ( y , Variable ) : y = full ( shape = [ 1 ] , dtype = x . dtype , fill_value = y ) if in_dygraph_mode ( ) : return _C_ops . equal ( x , y ) check_variable_and_dtype ( x , "x" , [ "bool" , "float32" , "float64" , "int32" , "int64" ] , "equal" ) check_variable_and_dtype ( y , "y" , [ "bool" , "float32" , "float64" , "int32" , "int64" ] , "equal" ) helper = LayerHelper ( "equal" , * * locals ( ) ) out = helper . create_variable_for_type_inference ( dtype = 'bool' ) out . stop_gradient = True helper . append_op ( type = 'equal' , inputs = { 'X' : [ x ] , 'Y' : [ y ] } , outputs = { 'Out' : [ out ] } ) return out