def test_iterable_dataset_factory_torch_integration(generate_examples_fn): import torch ex_iterable = ExamplesIterable(generate_examples_fn, {}) dataset = iterable_dataset(ex_iterable, format_type="torch") assert isinstance(dataset, IterableDataset) assert isinstance(dataset, torch.utils.data.IterableDataset) assert dataset._format_type == "torch" assert dataset._ex_iterable is ex_iterable
def test_iterable_dataset_factory(generate_examples_fn): ex_iterable = ExamplesIterable(generate_examples_fn, {}) dataset = iterable_dataset(ex_iterable) assert isinstance(dataset, IterableDataset) assert dataset._ex_iterable is ex_iterable