torch.ne(input, other, *, out=None)
paddle.not_equal(x, y, name=None)
其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下:
| PyTorch | PaddlePaddle | 备注 | | ————- | ———— | —————————————————— | | input | x | 输入的 Tensor ,仅参数名不同。 | | other | y | 输入的 Tensor ,仅参数名不同。 | | out | - | 表示输出的 Tensor ,Paddle 无此参数,需要进行转写。 |
# Pytorch 写法 torch.ne(input, other,out=y) # Paddle 写法 paddle.assign(paddle.ne(input, other, y))