isclose(input: Tensor, other: Tensor, rtol: _float = ..., atol: _float = ..., equal_nan: _bool = ...)Implementing kernel
C++ engine symbols that back this Python API.Element-wise approximate equality with absolute and relative tolerance.
Returns a boolean tensor that is True where the two operands are equal up
to a combined absolute / relative tolerance. Useful for comparing
floating-point results where bit-exact equality is too strict.
Parameters
Returns
TensorBoolean tensor (dtype bool) with shape broadcast(input.shape, other.shape).
Notes
Mathematical definition:
When equal_nan is True positions where both operands are NaN are
additionally marked True. Not differentiable.
Examples
>>> import lucid
>>> a = lucid.tensor([1.0, 2.0])
>>> b = lucid.tensor([1.0 + 1e-9, 2.5])
>>> lucid.isclose(a, b, rtol=1e-5, atol=1e-8)
Tensor([True, False])