Array tools › Blog
Field notes on comparing floating-point outputs down to the last bit — finding where two arrays first diverge, reading ULP distance, and telling normal rounding from a real bug. The free diff tool does the same work in your browser, nothing uploaded.
An ONNX vs PyTorch output mismatch is usually rounding, not a bug. How to find the first divergent element, read the ULP gap, and set a sane atol/rtol.
How to compare two NumPy arrays: array_equal vs allclose vs isclose, find where they first differ, and measure the gap in ULPs rather than guesswork.
Diff npy files the right way: check dtype and shape first, test bit-exact vs tolerant equality, and pinpoint the exact first differing index.
np.allclose not equal to tolerance? Decode the assert_allclose rtol/atol error, understand the defaults gotcha, and pick a tolerance from your own data.