latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay.functional.gcd
- tensorplay.functional.gcd(input, other, *, out=None) Tensor[source]
Computes the element-wise greatest common divisor (GCD) of
inputandother.Both
inputandothermust have integer types.Note
This defines .
- Parameters:
- Keyword Arguments:
out (Tensor, optional) – the output tensor.
Example:
>>> a = tensorplay.tensor([5, 10, 15]) >>> b = tensorplay.tensor([3, 4, 5]) >>> tensorplay.gcd(a, b) tensor([1, 2, 5]) >>> c = tensorplay.tensor([3]) >>> tensorplay.gcd(a, c) tensor([1, 1, 3])
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

