Using sqrt for better precision in cosine_similarity (#18250)
Summary:
address comment in #18168 .
Testing in CI...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18250
Differential Revision: D14568601
Pulled By: ailzhang
fbshipit-source-id: 39fbbdb08743b53fa665c7e88e4750cbe0976ec7