Function
_assert_close
(value1, value2, threshold, err_msg='')
Source from the content-addressed store, hash-verified
| 59 | |
| 60 | |
| 61 | def _assert_close(value1, value2, threshold, err_msg=''): |
| 62 | np.testing.assert_allclose( |
| 63 | value1, value2, |
| 64 | atol=threshold, rtol=threshold, |
| 65 | err_msg=err_msg, |
| 66 | ) |
| 67 | |
| 68 | delta = np.abs(value1 - value2).flatten() |
| 69 | return np.mean(delta), max(delta) |
| 70 | |
| 71 | |
| 72 | class NetGradientChecker: |
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…