Skip to content
fn

isclose_op

→TensorImplPtr
int isclose_op(const int & a, const int & b, double rtol, double atol)

Python wrappers

Public Python APIs implemented by this engine symbol.

Elementwise tolerance check: ∣a−b∣≤atol+rtol⋅∣b∣|a - b| \le \mathrm{atol} + \mathrm{rtol} \cdot |b|.

Composite over sub_op + abs_op + mul_op + add_op + less_equal_op — no dedicated kernel required. rtol and atol are materialised as same-shape constant tensors so the multiply does not depend on any scalar-broadcast support in the binary ops. Returns a bool tensor; not differentiable.

Math

yi=1 ⁣[∣ai−bi∣≤atol+rtol⋅∣bi∣] y_i = \mathbb{1}\!\left[ |a_i - b_i| \le \mathrm{atol} + \mathrm{rtol} \cdot |b_i| \right]

Parameters

a, bTensorImplPtr
Broadcastable operands.
rtoldouble
Relative tolerance (asymmetric in b).
atoldouble
Absolute tolerance.

Returns

TensorImplPtr

Bool tensor on the broadcast shape of a and b.

Notes

The asymmetry in b matches the reference framework's convention — swap operands if the symmetric formulation is needed.