remove BatchSampler type check (#29114)

* remove BatchSampler type check. test=develop
musl/disable_test_yolov3_temporarily
Kaipeng Deng 5 years ago committed by GitHub
parent 63e90ee331
commit b052149dcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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(

Loading…
Cancel
Save