Add relative and absolute tolerances for matrix_rank, pinv (#63102)
Summary:
This pull request introduces new keyword arguments for `torch.linalg.matrix_rank` and `torch.linalg.pinv`: `atol` and `rtol`.
Currently, only tensor overload has default values for either `atol` or `rtol`, the float overload requires both arguments to be specified.
FC compatibility: https://github.com/pytorch/pytorch/pull/63102#discussion_r710930509
Fixes https://github.com/pytorch/pytorch/issues/54151. Fixes https://github.com/pytorch/pytorch/issues/66618.
cc jianyuh nikitaved pearu mruberry walterddr IvanYashchuk xwang233 Lezcano
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63102
Reviewed By: H-Huang
Differential Revision: D31641456
Pulled By: mruberry
fbshipit-source-id: 4c765508ab1657730703e42975fc8c0d0a60eb7c