View source: R/gen-namespace.R
torch_fmod | R Documentation |
Fmod
torch_fmod(self, other)
self |
(Tensor) the dividend |
other |
(Tensor or float) the divisor, which may be either a number or a tensor of the same shape as the dividend |
Computes the element-wise remainder of division.
The dividend and divisor may contain both for integer and floating point
numbers. The remainder has the same sign as the dividend input
.
When other
is a tensor, the shapes of input
and
other
must be broadcastable .
if (torch_is_installed()) {
torch_fmod(torch_tensor(c(-3., -2, -1, 1, 2, 3)), 2)
torch_fmod(torch_tensor(c(1., 2, 3, 4, 5)), 1.5)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.