latest (dev)
Latest development documentation · Updated 2026-10-15
tensorplay.functional.frac
-
tensorplay.functional.frac(input, *, out=None) → Tensor[source]
Computes the fractional portion of each element in input.
outi=inputi−⌊∣inputi∣⌋∗sgn(inputi)
Example:
>>> tensorplay.frac(tensorplay.tensor([1, 2.5, -3.2]))
tensor([ 0.0000, 0.5000, -0.2000])
Help improve this page
Found an error, an unclear step, or a missing example?