torch.Tensor.add¶
- Tensor.add(other, *, alpha=1) Tensor ¶
将标量或张量加到
self
张量。如果同时指定了alpha
和other
,则other
的每个元素在使用前都会按alpha
缩放。当
other
是张量时,other
的形状必须与底层张量的形状 可广播请参阅
torch.add()
将标量或张量加到 self
张量。如果同时指定了 alpha
和 other
,则 other
的每个元素在使用前都会按 alpha
缩放。
当 other
是张量时,other
的形状必须与底层张量的形状 可广播
请参阅 torch.add()