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

PyTorch torch.fmod function

PyTorch torch.fmod function


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

)

print

(

result

)


PyTorch torch reference manual PyTorch torch reference manual