Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PyTorch torch.remainder function

PyTorch torch.remainder function


PyTorch torch reference manual 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

)

print

(

result

)


PyTorch torch reference manual PyTorch torch reference manual