Added linalg.tensorinv (#45969)
Summary:
This PR adds `torch.linalg.tensorinv` for NumPy compatibility.
Ref https://github.com/pytorch/pytorch/issues/42666
Pull Request resolved: https://github.com/pytorch/pytorch/pull/45969
Reviewed By: zhangguanheng66
Differential Revision: D25060568
Pulled By: mruberry
fbshipit-source-id: 3b145ce64e4bd5021bc229f5ffdd791c572673a0