Skip to content

Commit

Permalink
add an equivalence
Browse files Browse the repository at this point in the history
  • Loading branch information
SigureMo committed Aug 8, 2022
1 parent 03f2bf5 commit 9e81283
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ np.testing.assert_allclose(x, y, err_msg="compare x and y")
>
> 还需要考虑一些等价情况,比如 `self.assertEqual(..., True)``self.assertTrue(...)` 等价,因此 `self.assertEqual(np.allclose(...), True)` 等价于 `self.assertTrue(np.allclose(...))``self.assertEqual(np.array_equal(...), True)` 等价于 `self.assertTrue(np.array_equal(...))`
>
> 再比如说 `self.assertTrue(np.isclose(...).all())` 也是与 `self.assertTrue(np.allclose(...))` 等价的。
>
> 另外,还有部分单测仅仅使用了 `import numpy` 而非 `import numpy as np`,因此上述模式中的 `np` 在替换为 `numpy` 时也是等价的。
#### 目标二:添加 CI 检测脚本,阻止增量问题
Expand Down

0 comments on commit 9e81283

Please sign in to comment.