2020-04-16 02:16:40 +00:00
|
|
|
from abc import ABC, abstractmethod
|
|
|
|
|
2020-05-10 17:15:28 +00:00
|
|
|
from tests.base.dataloaders import CustomInfDataloader
|
2020-06-20 03:38:15 +00:00
|
|
|
from tests.base.dataloaders import CustomNotImplementedErrorDataloader
|
2020-05-05 16:31:15 +00:00
|
|
|
|
2020-04-16 02:16:40 +00:00
|
|
|
|
|
|
|
class ValDataloaderVariations(ABC):
|
|
|
|
|
|
|
|
@abstractmethod
|
2020-06-23 15:21:24 +00:00
|
|
|
def dataloader(self, *args, **kwargs):
|
2020-04-16 02:16:40 +00:00
|
|
|
"""placeholder"""
|
|
|
|
|
|
|
|
def val_dataloader(self):
|
|
|
|
return self.dataloader(train=False)
|
2020-05-04 20:51:39 +00:00
|
|
|
|
2020-06-23 15:21:24 +00:00
|
|
|
def val_dataloader__multiple_mixed_length(self):
|
|
|
|
lengths = [100, 30]
|
|
|
|
dataloaders = [self.dataloader(train=False, num_samples=n) for n in lengths]
|
|
|
|
return dataloaders
|
|
|
|
|
2020-05-04 20:51:39 +00:00
|
|
|
def val_dataloader__multiple(self):
|
|
|
|
return [self.dataloader(train=False),
|
|
|
|
self.dataloader(train=False)]
|
2020-05-05 16:31:15 +00:00
|
|
|
|
|
|
|
def val_dataloader__infinite(self):
|
|
|
|
return CustomInfDataloader(self.dataloader(train=False))
|
2020-06-20 03:38:15 +00:00
|
|
|
|
|
|
|
def val_dataloader__not_implemented_error(self):
|
|
|
|
return CustomNotImplementedErrorDataloader(self.dataloader(train=False))
|