Add OpInfo for `nn.functional.cosine_similarity` (#62959)
authorKushashwa Ravi Shrimali <kushashwaravishrimali@gmail.com>
Tue, 31 Aug 2021 16:45:09 +0000 (09:45 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 31 Aug 2021 17:31:36 +0000 (10:31 -0700)
commitca8dd296ee42fd68b8c9360d10916e02e009eeff
treed77a69332c5cd62ad78dd6dfa4e7cab1cc3dd8bc
parent0ef8760bf6b3e8098ef42df60f1e451234151f32
Add OpInfo for `nn.functional.cosine_similarity` (#62959)

Summary:
Please see https://github.com/facebookresearch/functorch/issues/78 and https://github.com/pytorch/pytorch/issues/54261.

Notes:

* Some redundant tests from `test_nn.py` have been removed. I'm unsure about precision checks if they can be removed as well.
* Broadcasting is also checked in the OpInfo for `cosine_similarity`.

cc: mruberry zou3519 Chillee

Pull Request resolved: https://github.com/pytorch/pytorch/pull/62959

Reviewed By: heitorschueroff

Differential Revision: D30520176

Pulled By: zou3519

fbshipit-source-id: 14e902eb4bcce875edab28a1669a2ea021052b9b
test/test_nn.py
torch/testing/_internal/common_methods_invocations.py