def METHOD_NAME(filepath, batch_size=256, num_threads=1, **kwargs):
    def _input_fn():
        dataset = LIBSVMDataset.prepare_dataset(data_uri=filepath, n_jobs=num_threads)
        sampler = DistributedSampler(dataset)
        return DataLoader(
            dataset=dataset, batch_size=batch_size, sampler=sampler, num_workers=0
        )  # should be 0 (pytorch bug)
    return _input_fn