torch.lcm
-
torch.lcm(input, other, *, out=None) → Tensor -
Вычисляет поэлементное наименьшее общее кратное (НОК)
inputиother.Типы
inputиotherдолжны быть целочисленными.Примечание
Здесь определено, что и .
- Параметры:
- Именованные аргументы:
-
out (Tensor, optional) – выходной тензор.
Пример:
>>> a = torch.tensor([5, 10, 15]) >>> b = torch.tensor([3, 4, 5]) >>> torch.lcm(a, b) tensor([15, 20, 15]) >>> c = torch.tensor([3]) >>> torch.lcm(a, c) tensor([15, 30, 15])
© 2026, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.14/generated/torch.lcm.html