-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Closed
Copy link
Labels
enhancementNot as big of a feature, but technically not a bug. Should be easy to fixNot as big of a feature, but technically not a bug. Should be easy to fixgood 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::affine_grid to the C++ API, so that C++ users can easily find the equivalent of Python API torch.nn.functional.affine_grid.
Steps
- Add
torch::nn::functional::affine_grid(...)intorch/csrc/api/include/torch/nn/functional/vision.h(add this file if it doesn’t exist). The function should have the following signature:
namespace torch {
namespace nn {
namespace functional {
inline Tensor affine_grid(
const Tensor& theta,
const IntArrayRef& size,
bool align_corners = false) {
...
}
} // namespace functional
} // namespace nn
} // namespace torch- Add tests for
torch::nn::functional::affine_grid(...)in test/cpp/api/functional.cpp. It would be great to provide different values fortheta/size/align_corners, and check that the output values are as expected (aka. same as the output values from Python). Also we should add tests to check that all errors are thrown correctly, by usingASSERT_THROWS_WITH.
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
enhancementNot as big of a feature, but technically not a bug. Should be easy to fixNot as big of a feature, but technically not a bug. Should be easy to fixgood 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