torch.frac
-
torch.frac(input, *, out=None) → Tensor -
Computes the fractional portion of each element in
input.Example:
>>> torch.frac(torch.tensor([1, 2.5, -3.2])) tensor([ 0.0000, 0.5000, -0.2000])
torch.frac(input, *, out=None) → Tensor Computes the fractional portion of each element in input.
Example:
>>> torch.frac(torch.tensor([1, 2.5, -3.2])) tensor([ 0.0000, 0.5000, -0.2000])
© 2025, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.9/generated/torch.frac.html