add break continue to docs

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/23091

Differential Revision: D16382604

Pulled By: eellison

fbshipit-source-id: 47432d844c811ecd87ad97155e835b07ae8056cc
This commit is contained in:
Elias Ellison 2019-07-19 12:13:18 -07:00 committed by Facebook Github Bot
parent 6dfecc7e01
commit 2ee0f0bc3a

View File

@ -572,6 +572,17 @@ For loops over constant ``torch.nn.ModuleList``
list for the type. For loops over a ``nn.ModuleList`` will unroll the body of the
loop at compile time, with each member of the constant module list.
Break and Continue
::
for i in range(5):
if i == 1:
continue
if i == 3:
break
print(i)
Return
``return a, b``