shlogg · Early preview
Super Kai (Kazuya Ito) @superkai_kazuya

Understanding GCD And LCM In PyTorch

Learn how to use `torch.gcd()` and `torch.lcm()` functions in PyTorch for calculating greatest common divisors and least common multiples of tensors. Examples included.

Buy Me a Coffee☕
*Memos:

My post explains square().
My post explains pow().
My post explains float_power().
My post explains abs() and sqrt().
My post explains trace(), reciprocal() and rsqrt().

gcd() can get the 0D or more D tensor of zero or more greatest common divisors from two of the 0D or more D tensors of zero or more elements as shown below:
*Memos:

gcd() can be used with torch or a tensor.
The 1st argument(input) with torch or using a tensor(Required-Type:tensor of int).
The 2nd argument with torch or the 1st argument is other(Required-Type:tensor of int).
There is out argument wi...