[ torch 参数更多 ] torch.where
torch.where
torch.where(condition, input, other, *, out=None)
参数映射
| PyTorch | PaddlePaddle | 备注 |
|---|---|---|
| condition | condition | 判断条件。 |
| input | x | 当 condition 为 true 时,选择 input 元素,仅参数名不一致。 |
| other | y | 当 condition 为 false 时,选择 other 中元素,仅参数名不一致。 |
| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 |