torch.Tensor.sub(other, *, alpha=1)
paddle.Tensor.subtract(y, name=None)
PyTorch 相比 Paddle 支持更多其他参数,具体如下:
other
# PyTorch 写法 x.sub(y, alpha=2) # Paddle 写法 x.subtract(2 * y) # 注:Paddle 直接将 alpha 与 y 相乘实现