pytorch
14b0191d - make assert_equal an example how to partial `torch.testing.assert_close` (#58918)

Commit
4 years ago
make assert_equal an example how to partial `torch.testing.assert_close` (#58918) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/58918 ~Instead of a distinct `torch.testing.assert_close` and `torch.testing.assert_equal`, this makes `torch.testing.assert_equal` a special case of `torch.testing.assert_close` for `rtol=atol=0`. In this case the closeness definition `abs(actual - expected) <= atol + rtol * abs(expected)` boils down to `abs(actual - expected) <= 0`. Since `abs(x)` can never be `<0`, this is equivalent to `abs(a - b) == 0` and this again boils down to `a == b`.~ Following https://github.com/pytorch/pytorch/pull/58918#issuecomment-860642057 and some offline discussions, we opted to use `assert_equal` as an example how to `partial` it. This makes maintaing the module a lot easier, because we don't need to keep two functions in sync. Test Plan: Imported from OSS Reviewed By: anjali411 Differential Revision: D29259404 Pulled By: mruberry fbshipit-source-id: fa1a1fa93672a7ed1c5f0e4beb0dcd45b5c14fce
Author
Parents
Loading