Skip to content

Commit ab62961

Browse files
caic99Copilot
andauthored
Update deepmd/pt/train/training.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Chun Cai <amoycaic@gmail.com>
1 parent 611809f commit ab62961

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

deepmd/pt/train/training.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ def get_opt_param(params):
157157
return opt_type, opt_param
158158

159159
def cycle_iterator(iterable: Iterable):
160+
"""
161+
Produces an infinite iterator by repeatedly cycling through the given iterable.
162+
163+
Args:
164+
iterable (Iterable): The iterable to cycle through.
165+
166+
Yields:
167+
Any: The next item from the iterable, cycling back to the beginning when the end is reached.
168+
"""
160169
while True:
161170
yield from iterable
162171

0 commit comments

Comments
 (0)