torch.sub
- torch.sub(input, other, *, alpha=1, out=None) → Tensor
Subtracts
, scaled by , from .
Subtracts , scaled by , from .
alphainputSupports broadcasting to a common shape, type promotion, and integer, float, and complex inputs.
Example:
>>> a = torch.tensor((1, 2))
>>> b = torch.tensor((0, 1))
>>> torch.sub(a, b, alpha=2)
tensor([1, 0])