This commit is contained in:
guoye yang 2021-01-07 10:23:09 +08:00
parent d80e4056f6
commit a3a09a4837
1 changed files with 2 additions and 1 deletions

View File

@ -128,7 +128,8 @@ class Dataset(object):
if self.stop_grad else jt.array(x)
if isinstance(batch, np.ndarray):
return to_jt(batch)
assert isinstance(batch, Sequence)
if not isinstance(batch, (list, tuple)):
return batch
new_batch = []
for a in batch:
if isinstance(a, np.ndarray) or \