fn
allclose
→boolallclose(a: Tensor, b: Tensor, rtol: float = 1e-05, atol: float = 1e-08, equal_nan: bool = False)Return True iff every element pair is close within tolerance.
Closeness predicate:
Note the asymmetry — the relative term uses |b|, so swapping
arguments can change the answer for marginal cases. This matches
the NumPy / reference-framework convention.
Parameters
Inputs to compare. Must be broadcastable.
Inputs to compare. Must be broadcastable.
rtolfloat= 1e-05Relative tolerance. Default
1e-5.atolfloat= 1e-08Absolute tolerance — dominates the bound when
|b| is small
(think of comparisons near zero). Default 1e-8.equal_nanbool= FalseWhen
True, NaN positions are treated as equal to other
NaN positions. Default False (any NaN makes the
predicate False).Returns
boolReduces to a single Python bool — synchronises any pending
GPU work to evaluate the final reduction.
See Also
isclose—element-wise variant that returns a Tensor of bools.