mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-13 05:07:03 +03:00
Fix minibatching
This commit is contained in:
parent
ded0df5e2f
commit
9bae0ddc50
|
@ -148,7 +148,7 @@ def minibatch(items, size=8):
|
||||||
'''
|
'''
|
||||||
items = iter(items)
|
items = iter(items)
|
||||||
while True:
|
while True:
|
||||||
batch_size = next(size) if hasattr(size, '__next__') else size
|
batch_size = next(size) #if hasattr(size, '__next__') else size
|
||||||
batch = list(cytoolz.take(int(batch_size), items))
|
batch = list(cytoolz.take(int(batch_size), items))
|
||||||
if len(batch) == 0:
|
if len(batch) == 0:
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue
Block a user