pytorch
3175f554 - Make nn.Sequential iterable (#28987)

Commit
5 years ago
Make nn.Sequential iterable (#28987) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/28987 We have `__iter__` defined on nn.ModuleList. Chainer's `Sequential` defines `__iter__`. This will also be helpful in modules which extend `nn.Sequential` and define a custom forward, because they can use the `for x in self` syntax that is supported in both python & TorchScript. Test Plan: Imported from OSS Differential Revision: D18402822 Pulled By: eellison fbshipit-source-id: 1ece0f891a9d37f401e232320f58b056d5481856
Author
Elias Ellison
Parents
Loading