For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/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
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!