torchoutil.pyoutil.math module

clamp(
x: T,
xmin: T | None = None,
xmax: T | None = None,
) T[source]
clip(
x: T,
xmin: T | None = None,
xmax: T | None = None,
) T[source]
nextafter(
x: float,
y: float,
) float[source]

Equivalent to math.nextafter for python <=3.8.

nextdown(
x: float,
) float[source]