From 2ce007cae0a2307997d8ffc43292fd505246e36b Mon Sep 17 00:00:00 2001 From: Kaipeng Deng Date: Tue, 8 Mar 2022 17:41:29 +0800 Subject: [PATCH] remove isinstance Dataset check. test=develop (#40184) --- python/paddle/fluid/dataloader/batch_sampler.py | 2 -- python/paddle/fluid/reader.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/python/paddle/fluid/dataloader/batch_sampler.py b/python/paddle/fluid/dataloader/batch_sampler.py index 3debeecfe4f..3a23c852563 100644 --- a/python/paddle/fluid/dataloader/batch_sampler.py +++ b/python/paddle/fluid/dataloader/batch_sampler.py @@ -113,8 +113,6 @@ class BatchSampler(Sampler): assert not shuffle, "shuffle should be False when sampler is set" self.sampler = sampler else: - assert isinstance(dataset, Dataset), \ - "dataset should be a paddle.io.Dataset" assert not isinstance(dataset, IterableDataset), \ "dataset should not be a paddle.io.IterableDataset" assert sampler is None, \ diff --git a/python/paddle/fluid/reader.py b/python/paddle/fluid/reader.py index 727ceca72d1..cbea289162c 100644 --- a/python/paddle/fluid/reader.py +++ b/python/paddle/fluid/reader.py @@ -332,8 +332,6 @@ class DataLoader(object): self.use_buffer_reader = use_buffer_reader self.worker_init_fn = worker_init_fn - assert isinstance(dataset, Dataset), \ - "dataset should be subclass instance of paddle.io.Dataset" self.dataset = dataset if not return_list and not in_dygraph_mode(): -- GitLab