mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
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:
parent
6dfecc7e01
commit
2ee0f0bc3a
|
|
@ -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``
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user