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

remove BatchSampler type check (#29114)

* remove BatchSampler type check. test=develop
上级 63e90ee3
......@@ -366,9 +366,6 @@ class DataLoader(object):
self.dataset_kind = _DatasetKind.MAP
if batch_sampler is not None:
assert isinstance(batch_sampler, BatchSampler), \
"batch_sampler should be None or subclass instance " \
"of paddle.io.BatchSampler"
assert batch_size == 1 and not shuffle and not drop_last, \
"batch_size/shuffle/drop_last should not be set when " \
"batch_sampler is given"
......
......@@ -80,14 +80,6 @@ class TestDataLoaderAssert(unittest.TestCase):
except AssertionError:
pass
# batch_sampler is not instance of BatchSampler
try:
loader = DataLoader(
dataset=dataset, places=place, batch_sampler=dataset)
self.assertTrue(False)
except AssertionError:
pass
# set batch_sampler and shuffle/batch_size/drop_last
try:
loader = DataLoader(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册