View source: R/gen-namespace.R
torch_lcm | R Documentation |
Lcm
torch_lcm(self, other)
self |
(Tensor) the input tensor. |
other |
(Tensor) the second input tensor |
Computes the element-wise least common multiple (LCM) of input
and other
.
Both input
and other
must have integer types.
This defines lcm(0, 0) = 0
and lcm(0, a) = 0
.
if (torch_is_installed()) {
if (torch::cuda_is_available()) {
a <- torch_tensor(c(5, 10, 15), dtype = torch_long(), device = "cuda")
b <- torch_tensor(c(3, 4, 5), dtype = torch_long(), device = "cuda")
torch_lcm(a, b)
c <- torch_tensor(c(3L), device = "cuda")
torch_lcm(a, c)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.