Skip to content

Conversation

@ShahriarRezghi
Copy link

No description provided.

@ShahriarRezghi
Copy link
Author

Why does this PR have caffe2 label?

@jerryzh168 jerryzh168 added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Aug 12, 2019
Copy link
Contributor

@yf225 yf225 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the PR @ShahriarSS! Overall it looks awesome. Once #23852 lands we can add the Fold module into the API parity whitelist, and then we can merge this PR.

ASSERT_EQ(y.size(2), 4);
ASSERT_EQ(y.size(3), 5);

// TODO check numel of grad
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we plan to implement this part as well?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I just forgot about it.


/// Applies fold over a 3-D input.
/// See https://pytorch.org/docs/master/nn.html#torch.nn.Fold to learn about
/// the exact behavior of this module.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation here looks great. We can experiment with porting all docs (including math formulas) from https://pytorch.org/docs/stable/nn.html#fold to here in this PR, or in a later PR if you prefer.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add the formulas here. We also need to do this for the other modules already implemented.

@yf225
Copy link
Contributor

yf225 commented Aug 15, 2019

@ShahriarSS Regarding the caffe2 label: it's probably because we changed the CMakeLists.txt file within the caffe2/ folder. This change is not really Caffe2 related and we can ignore the label.

@ShahriarRezghi
Copy link
Author

@yf225 I removed the TODO from fold test because fold doesn't have weights of any kind. I think nn::Fold is ready.

@yf225
Copy link
Contributor

yf225 commented Sep 6, 2019

@ShahriarSS Thanks! I am working on adding API parity test for nn::Fold (currently blocked by #25784), and I will merge the changes into this PR and then land it.

@yf225
Copy link
Contributor

yf225 commented Sep 9, 2019

@pytorchbot rebase this please

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yf225 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

${TORCH_SRC_DIR}/csrc/api/src/nn/modules/conv.cpp
${TORCH_SRC_DIR}/csrc/api/src/nn/modules/dropout.cpp
${TORCH_SRC_DIR}/csrc/api/src/nn/modules/embedding.cpp
${TORCH_SRC_DIR}/csrc/api/src/nn/modules/fold.cpp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShahriarSS the Facebook internal build seems to fail, and I am thinking we might need to add the fold.cpp entry into

torch_cpp_srcs = [
"torch/csrc/api/src/cuda.cpp", # this just forwards stuff, no real CUDA
"torch/csrc/api/src/data/datasets/mnist.cpp",
"torch/csrc/api/src/data/samplers/distributed.cpp",
"torch/csrc/api/src/data/samplers/random.cpp",
"torch/csrc/api/src/data/samplers/sequential.cpp",
"torch/csrc/api/src/data/samplers/stream.cpp",
"torch/csrc/api/src/jit.cpp",
"torch/csrc/api/src/nn/init.cpp",
"torch/csrc/api/src/nn/module.cpp",
"torch/csrc/api/src/nn/modules/batchnorm.cpp",
"torch/csrc/api/src/nn/modules/conv.cpp",
"torch/csrc/api/src/nn/modules/dropout.cpp",
"torch/csrc/api/src/nn/modules/embedding.cpp",
"torch/csrc/api/src/nn/modules/functional.cpp",
"torch/csrc/api/src/nn/modules/linear.cpp",
"torch/csrc/api/src/nn/modules/named_any.cpp",
"torch/csrc/api/src/nn/modules/rnn.cpp",
"torch/csrc/api/src/optim/adagrad.cpp",
"torch/csrc/api/src/optim/adam.cpp",
"torch/csrc/api/src/optim/lbfgs.cpp",
"torch/csrc/api/src/optim/optimizer.cpp",
"torch/csrc/api/src/optim/rmsprop.cpp",
"torch/csrc/api/src/optim/serialize.cpp",
"torch/csrc/api/src/optim/sgd.cpp",
"torch/csrc/api/src/serialize/input-archive.cpp",
"torch/csrc/api/src/serialize/output-archive.cpp",
]

facebook-github-bot pushed a commit that referenced this pull request Sep 9, 2019
Summary:
This PR makes the following improvements to C++ API parity test harness:
1. Remove `options_args` since we can get the list of options from the Python module constructor args.
2. Add test for mapping `int` or `tuple` in Python module constructor args to `ExpandingArray` in C++ module options.
3. Use regex to split up e.g. `(1, {2, 3}, 4)` into `['1', '{2, 3}', '4']` for `cpp_default_constructor_args`.
4. Add options arg accessor tests in `_test_torch_nn_module_ctor_args`.

We will be able to merge #24160 and #24860 after these improvements.
Pull Request resolved: #25828

Differential Revision: D17266197

Pulled By: yf225

fbshipit-source-id: 96d0d4a2fcc4b47cd1782d4df2c9bac107dec3f9
@pytorchbot pytorchbot added the module: nn Related to torch.nn label Sep 10, 2019
@yf225
Copy link
Contributor

yf225 commented Sep 10, 2019

@pytorchbot rebase this please

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yf225 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@yf225 merged this pull request in 3680cef.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

caffe2 Merged module: build Build system issues module: cpp Related to C++ API module: nn Related to torch.nn open source triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants