未验证 提交 2ce007ca 编写于 作者: K Kaipeng Deng 提交者: GitHub

remove isinstance Dataset check. test=develop (#40184)

上级 d4a4eb9d
...@@ -113,8 +113,6 @@ class BatchSampler(Sampler): ...@@ -113,8 +113,6 @@ class BatchSampler(Sampler):
assert not shuffle, "shuffle should be False when sampler is set" assert not shuffle, "shuffle should be False when sampler is set"
self.sampler = sampler self.sampler = sampler
else: else:
assert isinstance(dataset, Dataset), \
"dataset should be a paddle.io.Dataset"
assert not isinstance(dataset, IterableDataset), \ assert not isinstance(dataset, IterableDataset), \
"dataset should not be a paddle.io.IterableDataset" "dataset should not be a paddle.io.IterableDataset"
assert sampler is None, \ assert sampler is None, \
......
...@@ -332,8 +332,6 @@ class DataLoader(object): ...@@ -332,8 +332,6 @@ class DataLoader(object):
self.use_buffer_reader = use_buffer_reader self.use_buffer_reader = use_buffer_reader
self.worker_init_fn = worker_init_fn self.worker_init_fn = worker_init_fn
assert isinstance(dataset, Dataset), \
"dataset should be subclass instance of paddle.io.Dataset"
self.dataset = dataset self.dataset = dataset
if not return_list and not in_dygraph_mode(): if not return_list and not in_dygraph_mode():
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册