SafeOps: Utility and Helpers

SafeOps: Utility and Helpers#

Some helper functions.

tad_mctc.storch.utils.get_eps(x)[source]#

Get the smallest value corresponding to the input floating point precision of the input tensor. The small value will have the same dtype and lives on the same device as the input tensor.

Parameters:

x (Tensor) – Input tensor that defines the dtype.

Returns:

Smallest value of corresponding dtype.

Return type:

Tensor