deepr.utils.chunks

deepr.utils.chunks(iterable, chunk_size)[source]

Split Iterable into Iterable chunks.

>>> from deepr.utils import chunks
>>> for chunk in chunks(range(5), chunk_size=2):
...     print("-")
...     for idx in chunk:
...         print(idx)
-
0
1
-
2
3
-
4