PyTorch torch.remainder function
PyTorch torch reference manual
torch.remainder is a function in PyTorch used to compute element-wise remainder operations.
Function definition
torch.remainder(input, other, out=None)
Usage examples
Example
import
torch
Element-wise remainder
x
=
torch.
tensor
(
[
10.0
,
20.0
,
30.0
]
)
y
=
torch.
tensor
(
[
3.0
,
4.0
,
7.0
]
)
result
=
torch.
remainder
(
x
,
y
)
(
result
)