PyTorch torch.fmod Function
Pytorch torch Reference Manual
torch.fmodis a function in PyTorch used to compute the element-wise modulo remainder.
Function Definition
torch.fmod(input, other, out)
Usage Example
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)
# Compute element-wise modulo
x = torch.tensor([10, 15, 20])
y = torch.tensor([3, 4, 7])
result = torch.fmod(x, y)
print(result)
Other Extensions