Allow broadcasting along non-reduction dimension for cosine similarity (#62912)
authorNatalia Gimelshein <ngimel@fb.com>
Sat, 7 Aug 2021 02:13:42 +0000 (19:13 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Sat, 7 Aug 2021 02:17:04 +0000 (19:17 -0700)
commite6a3154519721eec323b227ea8dfbd05409cfe37
tree89b7eeb415d584bce8253b2fc2c908c4c5d137c3
parent6630d98ae58ffaeb503f803f556ff571a30ff5c9
Allow broadcasting along non-reduction dimension for cosine similarity (#62912)

Summary:
Checks introduced by https://github.com/pytorch/pytorch/issues/58559 are too strict and disable correctly working cases that people were relying on.

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

Reviewed By: jbschlosser

Differential Revision: D30165827

Pulled By: ngimel

fbshipit-source-id: f9229a9fc70142fe08a42fbf2d18dae12f679646
aten/src/ATen/native/Distance.cpp
test/test_nn.py
torch/nn/functional.py
torch/nn/modules/distance.py