def METHOD_NAME(self):
    # Test that build_batch_data_loader works when dataset size is not multiple of
    # batch size or num_workers
    def _test(N, batch_size, num_workers):
        ds = DatasetFromList(list(range(N)))
        sampler = InferenceSampler(len(ds))
        dl = build_batch_data_loader(ds, sampler, batch_size, num_workers=num_workers)
        data = list(iter(dl))
        self.assertEqual(len(data), len(dl))  # floor(N / batch_size)
        self._check_is_range(dl, N // batch_size * batch_size)
        dl = build_batch_data_loader(
            ds, sampler, batch_size, num_workers=num_workers, drop_last=False
        )
        data = list(iter(dl))
        self.assertEqual(len(data), len(dl))  # ceil(N / batch_size)
        self._check_is_range(dl, N)
    _test(48, batch_size=8, num_workers=3)
    _test(47, batch_size=8, num_workers=3)
    _test(46, batch_size=8, num_workers=3)
    _test(40, batch_size=8, num_workers=3)
    _test(39, batch_size=8, num_workers=3)