add support for sparse tensors in `torch.testing.assert_close` (#58844)
Summary:
This adds support for sparse tensors the same way `torch.testing._internal.common_utils.TestCase.assertEqual` does:
https://github.com/pytorch/pytorch/blob/5c7dace309cc84cc17629172ce97566285a9da58/torch/testing/_internal/common_utils.py#L1287-L1313
- Tensors are coalesced before comparison.
- Indices and values are compared individually.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/58844
Reviewed By: zou3519
Differential Revision: D29160250
Pulled By: mruberry
fbshipit-source-id: b0955656c2c7ff3db37a1367427ca54ca14f2e87