Python wrappers
Public Python APIs implemented by this engine symbol.Autograd node for element-wise truncation toward zero: .
Piecewise-constant like floor and ceil, and kept in the graph the same way,
with a zero gradient. No backend has a trunc kernel, so the forward picks
floor for and ceil below — on storages, so no autograd
node sits in between. It used to be that composition over tensors, and
once floor and ceil kept the graph a where node landed on the path,
which refuses a second derivative: fmod and frac lost theirs.
Math
, with
trunc(-0.0) = -0.0 and trunc(-0.5) = -0.0.
Notes
Integer dtypes are a no-op.