Commit Graph

5 Commits

Author SHA1 Message Date
Pavel Belevich
5aa01fd89a C++ API parity: AdaptiveMaxPool3d
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/26775

Test Plan: Imported from OSS

Differential Revision: D17627824

Pulled By: pbelevich

fbshipit-source-id: c4ae077ea5575c5d1df795e74a0dcb74a695ad06
2019-09-27 15:31:37 -07:00
Pavel Belevich
bb7a415bcc C++ API parity: AdaptiveMaxPool2d
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/26772

Test Plan: Imported from OSS

Differential Revision: D17627823

Pulled By: pbelevich

fbshipit-source-id: 195f1edabbbbe245de3568beb0c7925eb347118a
2019-09-27 12:41:38 -07:00
Pavel Belevich
0a393f6ef5 C++ API parity: AdaptiveMaxPool1d
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/26755

Test Plan: Imported from OSS

Differential Revision: D17627828

Pulled By: pbelevich

fbshipit-source-id: f898a4d2c269b98eb5905291914caa25bca87ce0
2019-09-27 09:10:39 -07:00
Will Feng
3cae3021e5 Add tests for C++ functional cosine_similarity and pairwise_distance, and clean up functional test code (#26559)
Summary:
This ensures that `F::cosine_similarity` and `F::pairwise_distance` can be used simply by including `torch/torch.h` and set `namespace F = torch::nn::functional`.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/26559

Differential Revision: D17507421

Pulled By: yf225

fbshipit-source-id: f895dde3634d5c8ca66ee036903e327e5cdab6b1
2019-09-24 09:10:42 -07:00
Will Feng
57a4b7c55d Re-organize C++ API torch::nn folder structure (#26262)
Summary:
This PR aims to re-organize C++ API `torch::nn` folder structure in the following way:
- Every module in `torch/csrc/api/include/torch/nn/modules/` (except `any.h`, `named_any.h`, `modulelist.h`, `sequential.h`, `embedding.h`) has a strictly equivalent Python file in `torch/nn/modules/`. For  example:
`torch/csrc/api/include/torch/nn/modules/pooling.h` -> `torch/nn/modules/pooling.py`
`torch/csrc/api/include/torch/nn/modules/conv.h` -> `torch/nn/modules/conv.py`
`torch/csrc/api/include/torch/nn/modules/batchnorm.h` -> `torch/nn/modules/batchnorm.py`
`torch/csrc/api/include/torch/nn/modules/sparse.h` -> `torch/nn/modules/sparse.py`
- Containers such as  `any.h`, `named_any.h`, `modulelist.h`, `sequential.h` are moved into `torch/csrc/api/include/torch/nn/modules/container/`, because their implementations are too long to be combined into one file (like `torch/nn/modules/container.py` in Python API)
- `embedding.h` is not renamed to `sparse.h` yet, because we have another work stream that works on API parity for Embedding and EmbeddingBag, and renaming the file would cause conflict. After the embedding API parity work is done, we will rename `embedding.h` to  `sparse.h` to match the Python file name, and move the embedding options out to options/ folder.
- `torch/csrc/api/include/torch/nn/functional/` is added, and the folder structure mirrors that of `torch/csrc/api/include/torch/nn/modules/`. For example, `torch/csrc/api/include/torch/nn/functional/pooling.h` contains the functions for pooling, which are then used by the pooling modules in `torch/csrc/api/include/torch/nn/modules/pooling.h`.
- `torch/csrc/api/include/torch/nn/options/` is added, and the folder structure mirrors that of `torch/csrc/api/include/torch/nn/modules/`. For example, `torch/csrc/api/include/torch/nn/options/pooling.h` contains MaxPoolOptions, which is used by both MaxPool modules in `torch/csrc/api/include/torch/nn/modules/pooling.h`, and max_pool functions in `torch/csrc/api/include/torch/nn/functional/pooling.h`.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/26262

Differential Revision: D17422426

Pulled By: yf225

fbshipit-source-id: c413d2a374ba716dac81db31516619bbd879db7f
2019-09-17 10:07:29 -07:00