Skip to content

Conversation

@eellison
Copy link
Contributor

@eellison eellison commented Oct 31, 2019

Stack from ghstack:

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.

Differential Revision: D18402822

[ghstack-poisoned]
Copy link
Contributor

@soumith soumith left a comment

Choose a reason for hiding this comment

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

go ahead!

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.

Differential Revision: [D18402822](https://our.internmc.facebook.com/intern/diff/D18402822)

[ghstack-poisoned]
eellison added 3 commits November 11, 2019 17:25
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.

Differential Revision: [D18402822](https://our.internmc.facebook.com/intern/diff/D18402822)

[ghstack-poisoned]
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.

Differential Revision: [D18402822](https://our.internmc.facebook.com/intern/diff/D18402822)

[ghstack-poisoned]
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.

Differential Revision: [D18402822](https://our.internmc.facebook.com/intern/diff/D18402822)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

@eellison merged this pull request in 3175f55.

@facebook-github-bot facebook-github-bot deleted the gh/eellison/26/head branch November 16, 2019 15:16
xxtEchjovs44 pushed a commit to xxtEchjovs44/pytorch that referenced this pull request Jan 29, 2020
ghstack-source-id: da2c354
Pull Request resolved: pytorch/pytorch#28987
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants