# tensorplay.functional.gcd Source: https://www.tensorplay.cn/docs/generated/tensorplay.functional.gcd.html ```python tensorplay.functional.gcd(input, other, *, out=None) → Tensor ``` Computes the element-wise greatest common divisor (GCD) of input and other. Both input and other must have integer types. > **Note** > > This defines $gcd(0, 0) = 0$. Parameters: - input ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor)) – the input tensor. - other ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor)) – the second input tensor Keyword Arguments: out ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.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]) ```