pytorch/docs/cpp/source
Will Feng 6ebfbdf4c6 Add named submodule support to nn::Sequential (#17552)
Summary:
Previously, we were not able to assign names to `nn::Sequential`'s submodules. This PR adds this feature to match the Python API. Example use:
```cpp
Sequential sequential(named_submodule({
      {"linear", Linear(10, 3)},
      {"conv2d", Conv2d(1, 2, 3)},
      {"dropout", Dropout(0.5)},
      {"batchnorm", BatchNorm(5)},
      {"embedding", Embedding(4, 10)},
      {"lstm", LSTM(4, 5)}
}));
```

It also enables loading parameters of Python `nn.Sequential` module with custom submodules names into C++ frontend, unblocking https://github.com/pytorch/vision/pull/728#issuecomment-466661344.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17552

Differential Revision: D14246834

Pulled By: yf225

fbshipit-source-id: 3030b5c5d68f6dd5d3e37ac4b4f98dc6d6d9ba72
2019-03-29 13:06:29 -07:00
..
notes Change deprecated IntList to IntArrayRef 2019-03-25 19:47:21 -07:00
check-doxygen.sh Add named submodule support to nn::Sequential (#17552) 2019-03-29 13:06:29 -07:00
conf.py Upgrade flake8-bugbear to master, fix the new lints. (#18507) 2019-03-27 08:07:41 -07:00
contributing.rst fix sigma in the middle of when word (#16227) 2019-01-23 08:35:32 -08:00
Doxyfile Directly include headers from ATen. 2019-01-24 11:22:27 -08:00
frontend.rst Fix C++ Frontend example in frontend.html (#15717) 2019-01-07 11:39:47 -08:00
index.rst Use at::zeros instead of torch::zeros in non-differentiable example (#15527) 2018-12-25 21:50:17 -08:00
installing.rst add debug/release tip to cpp docs (#17452) 2019-02-24 23:08:15 -08:00