PyTorch torch.fmod function
PyTorch torch reference manual
torch.fmod A function in PyTorch for computing the element-wise modulo remainder.
Function definition
torch.fmod(input, other, out)
Usage examples
Example
import
torch
Compute element-wise modulo
x
=
torch.
tensor
(
[
10
,
15
,
20
]
)
y
=
torch.
tensor
(
[
3
,
4
,
7
]
)
result
=
torch.
fmod
(
x
,
y
)
(
result
)