Skip to content

Commit faa6f44

Browse files
committed
add support for bitwise_xor
1 parent ccab584 commit faa6f44

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

python/paddle/tensor/logic.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,7 @@ def bitwise_or_(x: Tensor, y: Tensor, name: str | None = None) -> Tensor:
12091209
return _C_ops.bitwise_or_(x, y)
12101210

12111211

1212+
@param_two_alias(["x", "input"], ["y", "other"])
12121213
def bitwise_xor(
12131214
x: Tensor, y: Tensor, out: Tensor | None = None, name: str | None = None
12141215
) -> Tensor:
@@ -1224,9 +1225,15 @@ def bitwise_xor(
12241225
12251226
.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
12261227
1228+
.. note::
1229+
Alias Support: The parameter name ``input`` can be used as an alias for ``x``, and ``other`` can be used as an alias for ``y``.
1230+
For example, ``bitwise_xor(input=tensor_x, other=tensor_y, ...)`` is equivalent to ``bitwise_xor(x=tensor_x, y=tensor_y, ...)``.
1231+
12271232
Args:
12281233
x (Tensor): Input Tensor of ``bitwise_xor`` . It is a N-D Tensor of bool, uint8, int8, int16, int32, int64.
1234+
alias: ``input``.
12291235
y (Tensor): Input Tensor of ``bitwise_xor`` . It is a N-D Tensor of bool, uint8, int8, int16, int32, int64.
1236+
alias: ``other``.
12301237
out (Tensor|None, optional): Result of ``bitwise_xor`` . It is a N-D Tensor with the same data type of input Tensor. Default: None.
12311238
name (str|None, optional): The default value is None. Normally there is no need for
12321239
user to set this property. For more information, please refer to :ref:`api_guide_Name`.

0 commit comments

Comments
 (0)