@@ -12505,34 +12505,34 @@ def merge_dicts(*dicts):
12505
12505
add_docstr (
12506
12506
torch .where ,
12507
12507
r"""
12508
- where(condition, x, y , *, out=None) -> Tensor
12508
+ where(condition, input, other , *, out=None) -> Tensor
12509
12509
12510
- Return a tensor of elements selected from either :attr:`x ` or :attr:`y `, depending on :attr:`condition`.
12510
+ Return a tensor of elements selected from either :attr:`input ` or :attr:`other `, depending on :attr:`condition`.
12511
12511
12512
12512
The operation is defined as:
12513
12513
12514
12514
.. math::
12515
12515
\text{out}_i = \begin{cases}
12516
- \text{x }_i & \text{if } \text{condition}_i \\
12517
- \text{y }_i & \text{otherwise} \\
12516
+ \text{input }_i & \text{if } \text{condition}_i \\
12517
+ \text{other }_i & \text{otherwise} \\
12518
12518
\end{cases}
12519
12519
"""
12520
12520
+ r"""
12521
12521
.. note::
12522
- The tensors :attr:`condition`, :attr:`x `, :attr:`y ` must be :ref:`broadcastable <broadcasting-semantics>`.
12522
+ The tensors :attr:`condition`, :attr:`input `, :attr:`other ` must be :ref:`broadcastable <broadcasting-semantics>`.
12523
12523
12524
12524
Arguments:
12525
- condition (BoolTensor): When True (nonzero), yield x , otherwise yield y
12526
- x (Tensor or Scalar): value (if :attr:`x ` is a scalar) or values selected at indices
12525
+ condition (BoolTensor): When True (nonzero), yield input , otherwise yield other
12526
+ input (Tensor or Scalar): value (if :attr:`input ` is a scalar) or values selected at indices
12527
12527
where :attr:`condition` is ``True``
12528
- y (Tensor or Scalar): value (if :attr:`y ` is a scalar) or values selected at indices
12528
+ other (Tensor or Scalar): value (if :attr:`other ` is a scalar) or values selected at indices
12529
12529
where :attr:`condition` is ``False``
12530
12530
12531
12531
Keyword args:
12532
12532
{out}
12533
12533
12534
12534
Returns:
12535
- Tensor: A tensor of shape equal to the broadcasted shape of :attr:`condition`, :attr:`x `, :attr:`y `
12535
+ Tensor: A tensor of shape equal to the broadcasted shape of :attr:`condition`, :attr:`input `, :attr:`other `
12536
12536
12537
12537
Example::
12538
12538
0 commit comments