Remove unnecessary sync in linalg.det (#67014)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/67014
LAPACK functions return negative infos when there was an unexpected
input. This happens (for example) when the user does not specify
matrices of the correct size. We already check all this things on the
PyTorch end, so this check that induces a synchronisation is
unnecessary.
I also took this chance to avoid some code repetition in the computation
of the determinant of `P`. I also changed the use of `ExclusivelyOwned<Tensor>`
by regular `Tensors` + moving into the tuple, which should be as efficient or more.
cc jianyuh nikitaved pearu mruberry walterddr IvanYashchuk xwang233 Lezcano
Test Plan: Imported from OSS
Reviewed By: ngimel
Differential Revision: D32684851
Pulled By: mruberry
fbshipit-source-id: dc046d1cce4c07071d16c4e2eda36412bd734e0f