[ 输入参数用法不一致 ]torch.Tensor.where
torch.Tensor.where
torch.Tensor.where(condition, other)
paddle.where
paddle.where(condition, x=None, y=None, name=None)
Pytorch 为 Tensor 类方法,Paddle 为普通函数,具体如下:
参数映射
| PyTorch | PaddlePaddle | 备注 |
|---|---|---|
| condition | condition | 判断条件。 |
| self | x | 当 condition 为 true 时,选择的元素,调用 torch.Tensor 类方法的 self Tensor 传入。 |
| other | y | 当 condition 为 false 时,选择的元素,仅参数名不一致。需要转写。 |
