From ec778272d3eef215c8bfa15c673cf177f0cdb645 Mon Sep 17 00:00:00 2001 From: 201716010711 <87008376+201716010711@users.noreply.github.com> Date: Fri, 18 Nov 2022 17:05:51 +0800 Subject: [PATCH] delete logical_xor api (#48070) --- python/paddle/fluid/layers/nn.py | 44 -------------------------------- 1 file changed, 44 deletions(-) diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index 494fd6d47a..089597fdaf 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -159,7 +159,6 @@ __all__ = [ 'size', 'logical_and', 'logical_or', - 'logical_xor', 'logical_not', 'clip', 'clip_by_norm', @@ -12340,49 +12339,6 @@ def logical_or(x, y, out=None, name=None): ) -def logical_xor(x, y, out=None, name=None): - r""" - - ``logical_xor`` operator computes element-wise logical XOR on ``x`` and ``y``, and returns ``out``. ``out`` is N-dim boolean ``Tensor``. - Each element of ``out`` is calculated by - - .. math:: - - out = (x || y) \&\& !(x \&\& y) - - .. note:: - ``paddle.logical_xor`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting`. - - Args: - x (Tensor): the input tensor, it's data type should be one of bool, int8, int16, in32, in64, float32, float64. - y (Tensor): the input tensor, it's data type should be one of bool, int8, int16, in32, in64, float32, float64. - out(Tensor): The ``Tensor`` that specifies the output of the operator, which can be any ``Tensor`` that has been created in the program. The default value is None, and a new ``Tensor`` will be created to save the output. - name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`. - - Returns: - N-D Tensor. A location into which the result is stored. It's dimension equals with ``x``. - - Examples: - .. code-block:: python - - import paddle - import numpy as np - - x_data = np.array([True, False], dtype=np.bool_).reshape([2, 1]) - y_data = np.array([True, False, True, False], dtype=np.bool_).reshape([2, 2]) - x = paddle.to_tensor(x_data) - y = paddle.to_tensor(y_data) - res = paddle.logical_xor(x, y) - print(res) # [[False, True], [ True, False]] - """ - if in_dygraph_mode(): - return _C_ops.logical_xor(x, y) - - return _logical_op( - op_name="logical_xor", x=x, y=y, name=name, out=out, binary_op=True - ) - - @templatedoc() def logical_not(x, out=None, name=None): """ -- GitLab