hide top-level test functions from pytest's traceback (#58915)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/58915
History:
- It was included for internal helper functions in the initial proposal
in #53820
- It was removed in #54780, since it is not honored when used with
`pytest`'s `--tb=native`, which is the default for PyTorch
Since PyTorch shouldn't be the only user of `assert_(equal|close)` we
add it here to the top-level functions `assert_(equal|close)`. If
`pytest` is used without `--tb=native`, the traceback for
```python
assert torch.eq(actual, expected), "Tensors are not equal!"
torch.testing.assert_equal(actual, expected)
```
looks the same, making it more concise.
Test Plan: Imported from OSS
Reviewed By: anjali411
Differential Revision: D29259406
Pulled By: mruberry
fbshipit-source-id: acee47b30b7f14def27433f7d56a4b19d77393c0