-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Add C++ torch::nn::functional::pdist #27122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| /// Computes the p-norm distance between every pair of row vectors in the input. | ||
| /// This function will be faster if the rows are contiguous. | ||
| inline Tensor pdist(const Tensor& input, int64_t p = 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jon-tow My sincere apologies - I made a mistake and just realized that p should be double type (https://en.wikipedia.org/wiki/Norm_(mathematics)#p-norm). Sorry for the inconvenience :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yf225 Ah wow, good catch. I was also certain that p was integer rather than real.
yf225
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jon-tow Thanks for the great work! I will merge it first thing tomorrow morning :)
|
@yf225 You're welcome! |
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yf225 is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: Adds `torch::nn::functional::pdist` module support for the C++ API. Issue: pytorch#25883, pytorch#27082 Reviewer: yf225 Pull Request resolved: pytorch#27122 Differential Revision: D17685823 Pulled By: yf225 fbshipit-source-id: f8ceb09635385ef2e16a002e5fc255be8eb2ebf4
Summary: Adds `torch::nn::functional::pdist` module support for the C++ API. Issue: pytorch#25883, pytorch#27082 Reviewer: yf225 Pull Request resolved: pytorch#27122 Differential Revision: D17685823 Pulled By: yf225 fbshipit-source-id: f8ceb09635385ef2e16a002e5fc255be8eb2ebf4
Adds
torch::nn::functional::pdistmodule support for the C++ API.Issue: #25883, #27082
Reviewer: @yf225