MCPcopy Index your code
hub / github.com/numpy/numpy / assert_same_inf_values

Function assert_same_inf_values

numpy/testing/_private/utils.py:808–829  ·  view source on GitHub ↗

Verify all inf values match in the two arrays

(x, y, infs_mask)

Source from the content-addressed store, hash-verified

806 return y_id
807
808 def assert_same_inf_values(x, y, infs_mask):
809 """
810 Verify all inf values match in the two arrays
811 """
812 __tracebackhide__ = True # Hide traceback for py.test
813
814 if not infs_mask.any():
815 return
816 if x.ndim > 0 and y.ndim > 0:
817 x = x[infs_mask]
818 y = y[infs_mask]
819 else:
820 assert infs_mask.all()
821
822 if robust_any_difference(x, y):
823 msg = build_err_msg(
824 [x, y],
825 err_msg + '\ninf values mismatch:',
826 verbose=verbose, header=header,
827 names=names,
828 precision=precision)
829 raise AssertionError(msg)
830
831 try:
832 if strict:

Callers 1

assert_array_compareFunction · 0.85

Calls 4

robust_any_differenceFunction · 0.85
build_err_msgFunction · 0.85
anyMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…