-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Labels
good first issuemodule: cppRelated to C++ APIRelated to C++ APItriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
Context
We would like to add torch::nn::functional::pdist to the C++ API, so that C++ users can easily find the equivalent of Python API torch.nn.functional.pdist.
Steps
- Add
torch::nn::functional::pdist(...)intorch/csrc/api/include/torch/nn/functional/distance.h(add this file if it doesn’t exist). The function should have the following signature:
namespace torch {
namespace nn {
namespace functional {
inline Tensor pdist(
const Tensor& input,
int64_t p = 2) {
...
}
} // namespace functional
} // namespace nn
} // namespace torch- Add test for
torch::nn::functional::pdist(...)in test/cpp/api/functional.cpp. It can just check whether the function output is as expected for some simple cases.
Helpful Resources
There are quite a few PRs for adding new functionals / new modules for the C++ API (the list of PRs is in #25883), which can serve as great references. Also please ping @yf225 on this issue if you encounter any problems.
How do I claim this feature request?
Please comment in this issue if you are interested in working on it.
cc @yf225
Metadata
Metadata
Assignees
Labels
good first issuemodule: cppRelated to C++ APIRelated to C++ APItriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module