For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python function
assert_all_close
assert_all_close()
max.experimental.testing.assert_all_close(t1, t2, atol=1e-06, rtol=1e-06)
Asserts two tensors are elementwise close within the given tolerances.
-
Parameters:
-
- t1 (DLPackArray | Sequence[float | number[Any] | Sequence[Number | NestedArray]] | float | number[Any]) – The expected value. Converted to a
Tensormatchingt2’s dtype and device if it is not already one. - t2 (Tensor) – The actual
Tensorto compare against. - atol (float) – The maximum allowed absolute difference.
- rtol (float) – The maximum allowed relative difference.
- t1 (DLPackArray | Sequence[float | number[Any] | Sequence[Number | NestedArray]] | float | number[Any]) – The expected value. Converted to a
-
Raises:
-
AssertionError – If any element exceeds
atolorrtol. -
Return type:
-
None