Загрузка
otherThis function may be defined in terms of torch.div() as
torch.fmod(a, b) == a - a.div(b, rounding_mode="trunc") * b
Supports broadcasting to a common shape, type promotion, and integer and float inputs.
Example:
>>> torch.fmod(torch.tensor([-3., -2, -1, 1, 2, 3]), 2)
tensor([-1., -0., -1., 1., 0., 1.])
>>> torch.fmod(torch.tensor([1, 2, 3, 4, 5]), -1.5)
tensor([1.0000, 0.5000, 0.0000, 1.0000, 0.5000])