Loading [Contrib]/a11y/accessibility-menu.js
\u200E
文档[torch 参数更多 ]torch.subtract Edit on Github
[torch 参数更多 ]torch.subtract
torch.subtract(input,
other,
*,
alpha=1,
out=None)
paddle.subtract(x,
y,
name=None)
PyTorch 相比 Paddle 支持更多其他参数,具体如下:
参数映射
PyTorch |
PaddlePaddle |
备注 |
input |
x |
表示被减数的 Tensor,仅参数名不一致。 |
other |
y |
表示减数的 Tensor,仅参数名不一致。 |
alpha |
- |
表示other 的乘数,Paddle 无此参数。Paddle 应设置 y = alpha * other。 |
out |
- |
表示输出的 Tensor,Paddle 无此参数。 |
转写示例
alpha:表示other
的乘数
torch.subtract(x, y, alpha=2)
paddle.subtract(x, 2*y)
out:指定输出
torch.subtract(x, y, out=z)
paddle.assign(paddle.subtract(x, y), z)
文档反馈