mirror of https://github.com/Jittor/Jittor
fix dataset to_jittor bug
This commit is contained in:
parent
73eb05b36e
commit
23de860d68
|
@ -117,6 +117,7 @@ class Dataset(object):
|
|||
'''
|
||||
Change batch data to jittor array, such as np.ndarray, int, and float.
|
||||
'''
|
||||
if isinstance(batch, jt.Var): return batch
|
||||
to_jt = lambda x: jt.array(x).stop_grad() \
|
||||
if self.stop_grad else jt.array(x)
|
||||
if isinstance(batch, np.ndarray):
|
||||
|
|
Loading…
Reference in New Issue