latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay.functional.sub
- tensorplay.functional.sub(input, other, *, alpha=1, out=None) Tensor[source]
Subtracts
other, scaled byalpha, frominput.Supports broadcasting to a common shape, type promotion, and integer, float, and complex inputs.
- Parameters:
- Keyword Arguments:
alpha (Number) – the multiplier for
other.out (Tensor, optional) – the output tensor.
Example:
>>> a = tensorplay.tensor((1, 2)) >>> b = tensorplay.tensor((0, 1)) >>> tensorplay.sub(a, b, alpha=2) tensor([1, 0])
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

