Improve numerical precision of (s)logdet (#18449)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/18448 and https://github.com/pytorch/pytorch/issues/18450
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18449
Differential Revision: D14611638
Pulled By: soumith
fbshipit-source-id: 4f1f27ab5316a92d2783e734169f599afed743cf