torch_staintools.functional package

Subpackages

Submodules

torch_staintools.functional.eps module

Add small eps terms to avoid NaN in certain arithmetics (e.g., division and exp)

torch_staintools.functional.eps.get_eps(img: Tensor | None = None) Tensor

Get the eps based on the device input tensor.

Precision is defined by the global variable _eps_val.

Parameters:

img – If specified, then the output will be moved to the same device of the img.

Returns:

output eps as a tensor. It will be moved to the device of img if img is specified.

Module contents